Unit of Measure conversion tool
Project description
UOM
Static code analysis
Tools | Badges |
---|---|
Scrutinizer | |
Codacy | |
Codecov | |
Coveralls | |
CodeQL | |
CircleCI | |
TravisCI | |
Fossa | |
PyPI | |
PePy | |
Code formatting |
Description
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.
Where to get it
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
Usage
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.
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file uom-0.6.7.tar.gz
.
File metadata
- Download URL: uom-0.6.7.tar.gz
- Upload date:
- Size: 39.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05c9db7dad7251892ff86efa6c8ec5c32bea95b3bbd71faae433caee211893c2 |
|
MD5 | 3e7b09572d46e797a9d6964bec59049a |
|
BLAKE2b-256 | 9351b095f230df6afc36681131c903fa201ddc75ad14e0a186b9e3be66d6b7c9 |
File details
Details for the file uom-0.6.7-py2.py3-none-any.whl
.
File metadata
- Download URL: uom-0.6.7-py2.py3-none-any.whl
- Upload date:
- Size: 38.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac4c80e92d4085a6d531ffdd4585a637edc855ce5ea9ee4ade35ddd154bb980f |
|
MD5 | 693fe29505147e6cf7d605895084aca0 |
|
BLAKE2b-256 | 70cbac2997a336d638eb2c710f8cbcb9656413d7759e977ae5f83aed13ef9bf4 |