Skip to main content

Unit of Measure conversion tool

Project description

UOM

Build Status CodeQL CircleCI Scrutinizer Code Quality Coverage Status Codacy Badge

Build package

pip3 install wheel python3 setup.py bdist_wheel

Unit of Measure conversion tool

The conversion factors and unit symbols are based on the Energistics UOM 1.0: https://www.energistics.org/energistics-unit-of-measure-standard/ extended with few extra unit aliases and “unitless” special unit that cannot be converted.

The units are case sensitives.

Install

pip install uom

Examples

Please find a few 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_value

print(convert(value=10, source='m', target='ft'))

Return the base (SI) unit and if you are using unit alias you can find the equivalent 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 in the issue list.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

uom-0.5.1-py3.10.egg (73.3 kB view hashes)

Uploaded Source

uom-0.5.1-py2.py3-none-any.whl (67.3 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page