a mechanical engineering toolbox
source code - https://github.com/nagordon/mechpy
documentation - https://nagordon.github.io/mechpy/
Neal Gordon
2017-02-20
Neal Gordon
2017-2-20
Not a lot of effort was put towards make a new units module because there are already some good ones out there. This is bascially a demo of them, and can be bundled into an executable so that python isn't required.
This demo of the units module is a few different attempts at creating a fast, converter for units. unitconvert1 function or uc1
uses the sympy.physics package. The uc2
package uses the pint module. And uc3
uses the python-quantities package .
from units import uc1, uc3
# uc1 uses sympy
uc1(1.0,'psi','kPa')
uc1(1.0,'newton','pound')
help(uc3)
for d in ['ft', 'meter', 'mil', 'mile','inch', 'yard', 'fathom', 'light_year']:
uc3(1,'ft',d)
uc3(1,'psi','kPa')
from units import in_mm
in_mm()