https://github.com/scitools/cf-units
Units of measure as required by the Climate and Forecast (CF) Metadata Conventions
https://github.com/scitools/cf-units
Last synced: 6 months ago
JSON representation
Units of measure as required by the Climate and Forecast (CF) Metadata Conventions
- Host: GitHub
- URL: https://github.com/scitools/cf-units
- Owner: SciTools
- License: bsd-3-clause
- Created: 2015-03-12T21:09:35.000Z (over 11 years ago)
- Default Branch: main
- Last Pushed: 2025-06-12T00:58:56.000Z (about 1 year ago)
- Last Synced: 2025-06-12T15:09:26.474Z (about 1 year ago)
- Language: Python
- Homepage: https://cf-units.readthedocs.io/en/latest/
- Size: 1.3 MB
- Stars: 73
- Watchers: 11
- Forks: 50
- Open Issues: 27
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# [cf-units](https://cf-units.readthedocs.io/en/latest/)
#### Units of measure as defined by the Climate and Forecast (CF) Metadata Conventions.
| | |
|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ⚙️ CI | [](https://github.com/SciTools/cf-units/actions/workflows/ci-locks.yml) [](https://github.com/SciTools/cf-units/actions/workflows/ci-manifest.yml) [](https://github.com/SciTools/cf-units/actions/workflows/ci-tests.yml) [](https://github.com/SciTools/cf-units/actions/workflows/ci-wheels.yml) [](https://results.pre-commit.ci/latest/github/SciTools/cf-units/main) |
| 💬 Community | [](https://github.com/SciTools/cf-units/discussions) |
| 📖 Documentation | [](https://cf-units.readthedocs.io/en/latest/?badge=latest) |
| 📈 Health | [](https://codecov.io/gh/SciTools/cf-units) |
| ✨ Meta | [](https://github.com/psf/black) [](https://pycqa.github.io/isort/) [](https://github.com/PyCQA/flake8) [](https://github.com/SciTools/cf-units/blob/main/LICENSE) [](https://pixi.sh) |
| 📦 Package | [](https://anaconda.org/conda-forge/cf-units) [](https://pypi.org/project/cf-units/) [](https://pypi.org/project/cf-units/) [](https://doi.org/10.5281/zenodo.1257902) |
| 🧰 Repo | [](https://github.com/SciTools/cf-units/commits/main) [](https://github.com/SciTools/cf-units/graphs/contributors) [](https://github.com/SciTools/cf-units/releases) |
| | |
## Table of Contents
[comment]: # (NOTE: toc auto-generated with
https://github.com/jonschlinkert/markdown-toc
$> markdown-toc -i --bullets='-' README.md)
[comment]: # (This entire README can be markdown linted with
https://github.com/igorshubovych/markdownlint-cli
$ markdownlint README.md)
- [Overview](#overview)
- [Example](#example)
- [Get in Touch](#get-in-touch)
- [Credits, Copyright and License](#credits-copyright-and-license)
## Overview
Units of measure as required by the Climate and Forecast (CF) metadata
conventions.
Provision of a wrapper class to support Unidata/UCAR UDUNITS-2 library, and the
cftime calendar functionality.
Documentation can be found at .
### Example
>>> from cf_units import Unit
>>> km = Unit('kilometers')
>>> m = Unit('meters')
>>> m.convert(1500, km)
1.5
## Get in Touch
- Questions, ideas, general discussion or announcements
of related projects: use the
[Discussions space](https://github.com/SciTools/cf-units/discussions).
- Report bugs:
[submit a GitHub issue](https://github.com/SciTools/cf-units/issues).
- Suggest features: see our [contributing guide](.github/CONTRIBUTING.md).
## Credits, Copyright and License
cf-units is developed collaboratively under the SciTools umbrella.
A full list of code contributors ("cf-units contributors") can be found at
https://github.com/SciTools/cf-units/graphs/contributors.
Code is just one of many ways of positively contributing to cf-units, please
see our [contributing guide](.github/CONTRIBUTING.md) for more details on how
you can get involved.
cf-units is released under a BSD-3 license. See [LICENSE](LICENSE) for full
terms.
The [Met Office](https://metoffice.gov.uk) has made a significant
contribution to the development, maintenance and support of this library.
All Met Office contributions are copyright on behalf of the British Crown.