skillfed

cf-units

Units of measure as required by the Climate and Forecast (CF) metadata conventions

cf-units v3.3.1 75.4K downloads/30d#14,718 on PyPI80
Permissive license BSD-3-Clause Active released

What it is and what it does

cf-units is a Python library that implements units of measure as specified by the Climate and Forecast Metadata Conventions, a standard used across earth science data formats like NetCDF. It depends on numpy for array operations, cftime for time-related units, and jinja2 for template rendering. The package is designed for scientists and researchers working with atmospheric, oceanographic, and climate data who need to ensure their measurements conform to CF standards.

The library handles unit representation, validation, and operations within the CF framework. It is actively maintained, supports Python 3.11–3.14, and provides pre-built wheels for common platforms (macOS, Linux, Windows), reducing installation complexity for most users. With no known security vulnerabilities and a permissive BSD-3-Clause license, it is suitable for both academic and commercial projects.

Use it for:

  • Validate and standardize units in NetCDF climate datasets to ensure CF metadata compliance.
  • Convert between equivalent unit representations in atmospheric and oceanographic data pipelines.
  • Build data processing workflows that require consistent unit handling across multiple earth science sources.
  • Integrate CF-compliant unit metadata into scientific data analysis and visualization tools.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

cf-units provides units of measure as defined by the Climate and Forecast (CF) Metadata Conventions, enabling standardized unit handling for scientific data in atmospheric science, oceanography, and climate research.

Yes. cf-units is production-stable, actively maintained, has no known vulnerabilities, and carries a permissive license. Install friction is moderate but manageable via pre-built wheels. Install it if you work with CF-compliant earth science data (climate, oceanography, meteorology) and need standardized unit handling; otherwise it is not necessary.

Install

cf-units on PyPI

pip

pip install cf-units

uv

uv add cf-units

poetry

poetry add cf-units

Installing cf-units

Before you install

Medium install friction due to compiled wheels for specific platforms (macOS arm64/x86_64, Linux x86_64, Windows amd64). Actively maintained with recent releases; last commit 2026-08-10 and production-stable status indicate reliable upkeep.

License in practice

BSD-3-Clause (permissive) allows commercial and private use with minimal restrictions, requiring only license and copyright notice retention.

Quickstart

pip install cf-units

import cf_units

# Create a unit object following CF conventions
temperature_unit = cf_units.Unit('K')  # Kelvin
print(temperature_unit)

Requires Python 3.11 or later; compiled wheels are available for macOS (arm64, x86_64), Linux (x86_64), and Windows (amd64)—other platforms may require building from source.

Verify before relying

  • Whether the package handles unit conversion between different CF-compliant systems or only validates/represents units.
  • Performance characteristics when working with large arrays or high-frequency unit operations.

Package facts

License BSD-3-Clause (permissive)
Python support supports the current Python release (>=3.11)
Install friction medium — platform-specific wheel
Runtime dependencies 3 — cftime, jinja2, numpy
Maintenance actively maintained — 210 days since the last release
Last repo commit
First released
Downloads 75,415/month — #14,718 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: cf_units-3.3.1-cp311-abi3-macosx_15_0_arm64.whl; cf_units-3.3.1-cp311-abi3-macosx_15_0_x86_64.whl; cf_units-3.3.1-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; cf_units-3.3.1-cp311-abi3-win_amd64.whl

Keywords: units, cf, cf-metadata, netcdf, science, earth-science, oceanography, meteorology, climate, python

Development Status :: 5 - Production/StableIntended Audience :: Science/ResearchOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonTopic :: Scientific/EngineeringTopic :: Scientific/Engineering :: Atmospheric ScienceTopic :: Scientific/Engineering :: Oceanography

Tags

CF metadata unitsclimate forecast unitsscientific unit conversionnetcdf unit handlingearth science unitsmeteorology units library
climate-dataearth-sciencemetadata-standards

More Scientific/Engineering packages