Tools | Badges |
---|---|
Scrutinizer | |
Codacy | |
Codecov | |
Coveralls | |
CodeQL | |
CircleCI | |
TravisCI | |
Fossa | |
PyPI | |
PePy | |
Code formatting |
Python unit of measure (UOM) conversion tool
Energistics UOM 1.0 (https://www.energistics.org/energistics-unit-of-measure-standard/) is the primary source of conversion factors and unit symbols. We extended it with additional unit aliases and a "unitless" unit that doesn't have any conversion.
The units are case-sensitive.
The source code is available on GitHub at: https://github.com/Schlumberger/UOM
Binary installers for the latest released version are available at the Python Package Index (PyPI).
pip install uom
Please find examples of possible utilization:
Find conversion factors to be applied to convert from one unit to another
from uom import conversion_factors
scale, offset = conversion_factors(source='m', target='ft')
Convert a value from one unit to another
from uom import convert
print(convert(value=10, source='m', target='ft'))
Return the base SI ( https://en.wikipedia.org/wiki/International_System_of_Units) unit. If you are using unit alias you can find the compatible Energistics UOM symbol
from uom import base_unit, unit_alias
print(base_unit('kft.lbf'))
print(unit_alias('kft.lbf'))
If you have suggestions for improvement or you found bugs, please don't hesitate to put them on the issue list.