Syngenta Digital Units of Measure
Centralized source of canonical unit of measures for lookup and conversion
Definitions
- Unit of measure code (“UoM Code”): A small string/token that forms part of a controlled vocabulary (e.g., ADAPT, UN Rec 20, UCUM, QUDT) and represents a unit of measure (e.g., “meter”)
- Input Code Vocabulary (“UoM Voc”): A small string/token that represents the controlled vocabulary that a unit of measure code belongs to (e.g., “ADAPT”, “UCUM”).
- Dimension: a label for a family of units of measure that represent the same phenomenon. For example, “DISTANCE” represents a phenomenon represented by “meter”, “mile”, “inch”, “millimeter”, etc. We have a controlled vocabulary of these dimensions.
- Unit of measure System: A family of units of measure (cutting across all dimensions) that have a common cultural origin or organizing principles (e.g., “METRIC”, “IMPERIAL”).
Features
Retrieve the dimension of a given unit of measure
from syngenta_digital_uoms.common.vocabulary import Vocabulary
def retrieve_dimension_from_uom():
vocabulary = Vocabulary()
return vocabulary.get_dimension('min') # Returns 'TIME'
Retrieve list of unique dimensions from respective vocabulary
from syngenta_digital_uoms.common.vocabulary import Vocabulary
def retrieve_dimensions():
vocabulary = Vocabulary(vocab_type='adapt') # 'adapt' is the default vocabulary type
return vocabulary.list_dimensions()
Retrieve list of all units of measure from a given dimension
from syngenta_digital_uoms.common.vocabulary import Vocabulary
def retrieve_uoms_from_dimension():
vocabulary = Vocabulary()
return vocabulary.list_dimension_uoms('DISTANCE')
Retrieve canonical unit of measure from given dimension
from syngenta_digital_uoms.common.vocabulary import Vocabulary
def retrieve_uoms_from_dimension():
vocabulary = Vocabulary()
return vocabulary.get_canonical_uom('DISTANCE') # Returns 'm', as meter is the canonical unit of the DISTANCE dimension.
Retrieve the canonical unit of measure from a given unit's dimension
from syngenta_digital_uoms.util.converter import Converter
def convert_uom_to_canonical():
converter = Converter()
return converter.convert_uom('ft') # Returns 'm', as meter is the canonical unit of the DISTANCE dimension.
Convert a given value across units of measure
from syngenta_digital_uoms.util.converter import Converter
def convert_value_across_uoms():
converter = Converter()
return converter.convert_value(input_uom_code='ft',
input_value=100,
output_uom_code='km') # Returns 0.03048, as 100 feet is equivalent to 0.03048 kilometers.
Metadata
Release files for syngenta-digital-uoms 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| syngenta_digital_uoms-0.0.8.tar.gz | 39.8 kB | Without provenance | Details for syngenta_digital_uoms-0.0.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| syngenta_digital_uoms-0.0.8-py3-none-any.whl | Python 3 | none | any | Details for syngenta_digital_uoms-0.0.8-py3-none-any.whl |
Total release size: 79.2 kB
Release files / syngenta_digital_uoms-0.0.8.tar.gz
| Download URL | syngenta_digital_uoms-0.0.8.tar.gz |
|---|---|
| Size | 39.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
51cdba95019a3317c258831364268a5a6017a6ce6fce884eca0d0f477e14a3f1
|
|
BLAKE2b-256 checksum How to use checksums |
6139d4a79bbbd3a23f21afe2e9c1c389d0297bde5bc78bab2507fd6897b417eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.6
|
Release files / syngenta_digital_uoms-0.0.8-py3-none-any.whl
| Download URL | syngenta_digital_uoms-0.0.8-py3-none-any.whl |
|---|---|
| Size | 39.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2b3060db53bbc223ababc8baa6b9c54250ca67ef81504ba64ecafa493ac10843
|
|
BLAKE2b-256 checksum How to use checksums |
e6f1be26f1f2b691538d3d4684991b73f24144a4531f7cfcc706587436b2c2f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.6
|
Security for syngenta-digital-uoms 0.0.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.