measurement
Easily use and manipulate unit-aware measurements in Python.
What it is and what it does
Measurement provides unit-aware objects for common physical quantities—distance, weight, temperature, energy, speed, volume, time, and area—inspired by Django's Distance class. You create a measurement by specifying a value in any supported unit, then convert, compare, or combine measurements across different units. Internally, values are stored as floating-point numbers in a standard SI unit, which means conversions are fast but subject to the precision limits of floating-point arithmetic.
The package is useful when you need to work with physical quantities in code and want to avoid manual unit conversion or unit-mismatch bugs. It depends only on sympy and installs with low friction. The codebase is dormant (last release January 2023, last commit February 2024) but marked Production/Stable and supports Python 3.7+, making it suitable for applications that don't require active maintenance or new features.
Use it for:
- Convert between units in scientific or engineering calculations without manual conversion factors.
- Store and manipulate physical measurements in web applications or APIs that need to accept input in different units.
- Perform arithmetic on measurements (adding weights, combining distances) while preserving unit awareness.
- Build domain-specific tools for fields like GIS, chemistry, or physics that work with standardized unit objects.
- Validate and normalize user input that specifies quantities in mixed or non-standard units.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides unit-aware measurement objects for Python that support conversion between different units and arithmetic operations across multiple measurement types including distance, weight, temperature, energy, speed, volume, time, and area.
Yes, if you need straightforward unit conversion and arithmetic for common physical quantities in a stable, low-dependency package. The MIT license and low install friction make it a safe choice. No, if you require active maintenance, high-precision floating-point calculations, or support for exotic measurement types—the dormant status and floating-point precision caveat suggest it is not evolving to meet new demands.
Install
measurement on PyPI
pip
pip install measurementuv
uv add measurementpoetry
poetry add measurementInstalling measurement
Before you install
Low install friction with a single dependency on sympy. The package is dormant (last commit 2024-02-19, no release for 1312 days), but remains marked Production/Stable and supports current Python versions (3.7+). Suitable for stable, non-evolving use cases.
License in practice
MIT license (permissive) means you can use, modify, and distribute this package freely in both open-source and commercial projects with minimal restrictions.
Quickstart
pip install measurement
from measurement.measures import Weight
weight_1 = Weight(lb=125)
weight_2 = Weight(kg=40)
added = weight_1 + weight_2
print(added.kg)
Verify before relying
- Whether floating-point precision limitations documented in the description materially affect typical use cases beyond the extraterrestrial navigation example.
- Current test coverage and whether dormant status reflects stability or abandonment risk for edge cases.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — sympy |
| Maintenance | dormant — 1,312 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,128,574/month — #4,323 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: measurement-3.2.2-py3-none-any.whl
Keywords: measurement
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
ansys-unitsManages physical quantities with numerical…
permissive · top 15,000 on PyPI
PintPint defines, operates on, and converts between…
permissive · top 5,000 on PyPI
isqxisqx provides type-annotation-friendly metadata…
permissive · top 15,000 on PyPI
quantitiesQuantities handles arithmetic and unit…
unclear · top 15,000 on PyPI
typedunitsImplements unit of measurement arithmetic with…
permissive · top 15,000 on PyPI
binaryConverts between binary (IEC) and decimal (SI)…
permissive · top 15,000 on PyPI
pint-xarrayAdds physical units support to xarray datasets…
permissive · top 15,000 on PyPI
quantulum3Extracts quantities, measurements, and their…
permissive · top 15,000 on PyPI
accessCalculates spatial accessibility metrics to…
permissive · top 15,000 on PyPI
hepunitsProvides units and physical constants in the…
permissive · top 15,000 on PyPI