Mirror of lifefrom-units 1.1.0 (Zenodo doi:10.5281/zenodo.24568184, GitHub caraulani/lifefrom-units)
afecedd verified Download python/src/lifefrom_units/__init__.py from lifefrom/lifefrom-units: direct link, hf CLI and curl.
- Browser
- Download file 1.16 kB
-
https://huggingface.co/datasets/lifefrom/lifefrom-units/resolve/main/python/src/lifefrom_units/__init__.py
- Command line
-
hf download hf://datasets/lifefrom/lifefrom-units/python/src/lifefrom_units/__init__.py
-
curl -L -o __init__.py https://huggingface.co/datasets/lifefrom/lifefrom-units/resolve/main/python/src/lifefrom_units/__init__.py
1.16 kB
| """lifefrom_units: normalise clinical lab unit spellings and convert values with sourced factors. | |
| from lifefrom_units import convert, normalize_unit | |
| normalize_unit("mcg/l") | |
| 'µg/L' | |
| round(convert(5.4, "mmol/L", "mg/dL", analyte="glucose"), 1) | |
| 97.3 | |
| """ | |
| from .core import ( | |
| SPEC, | |
| AmbiguousUnitError, | |
| AmbiguousValueError, | |
| ForbiddenConversionError, | |
| IncompatibleUnitsError, | |
| InvalidValueError, | |
| LifeFromUnitsError, | |
| NoSourcedConversionError, | |
| QualifiedValueError, | |
| UnknownAnalyteError, | |
| UnknownUnitError, | |
| analytes, | |
| convert, | |
| convert_result, | |
| explain, | |
| normalize_unit, | |
| parse_result, | |
| parse_value, | |
| same_unit, | |
| unit_info, | |
| ) | |
| from . import core | |
| __version__ = SPEC["version"] | |
| __all__ = [ | |
| "AmbiguousUnitError", "AmbiguousValueError", "ForbiddenConversionError", "IncompatibleUnitsError", "InvalidValueError", | |
| "LifeFromUnitsError", "NoSourcedConversionError", "QualifiedValueError", "UnknownAnalyteError", "UnknownUnitError", "analytes", | |
| "convert", "convert_result", "core", "explain", "normalize_unit", "parse_result", "parse_value", "same_unit", "unit_info", "__version__", | |
| ] | |