--- id: quantities version: "0.16.4" license: unclear license_treatment: unclear maintenance: active --- # quantities — Support for physical quantities with units, based on numpy License: unclear · Maintenance: active · Downloads: 263.6K/mo ## What it is and what it does Quantities is a Python library for working with physical quantities—numbers paired with units and dimensionality. It extends numpy to let you perform arithmetic on quantities while automatically tracking and enforcing dimensional consistency; dividing distance by time yields a velocity with the correct units, and attempting to add incompatible units raises an error. The library is built on numpy and integrates with many numpy ufuncs, making it suitable for scientific and engineering calculations where unit safety matters. The package is actively maintained and has a stable API, but the authors explicitly note that test coverage is incomplete and recommend against mission-critical applications. It depends only on numpy and installs as a pure Python wheel with low friction. Use it for: - Perform dimensional analysis in physics or engineering simulations where unit mismatches should be caught automatically. - Convert between unit systems (e.g., metres to feet, seconds to hours) while preserving quantity semantics. - Build scientific data pipelines where quantities carry both magnitude and dimensionality through calculations. - Validate physical calculations by ensuring operations respect dimensional consistency rules. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Quantities handles arithmetic and unit conversions for physical quantities with magnitude, dimensionality, and optional uncertainty, built on numpy. Yes, if you need unit-aware arithmetic in scientific code and can tolerate incomplete test coverage. The low install friction, active maintenance, and numpy integration make it straightforward to adopt. No, if your work is mission-critical or requires bulletproof test coverage—the package's own documentation discourages such use. Verify the license terms before committing. ## Install pip install quantities uv add quantities poetry add quantities ## Installing quantities Before you install: Low install friction; pure Python wheel. Maintenance is active with recent commits, though the package notes test coverage remains incomplete and is not recommended for mission-critical applications. License in practice: License treatment is unclear—the package states it uses only BSD-compatible code but provides no explicit SPDX identifier or raw license field in metadata, so you should verify the actual license terms before use. Quickstart: pip install quantities import quantities as pq distance = 42 * pq.metre time = 17 * pq.second velocity = distance / time print(f"{velocity.magnitude:.3f} {velocity.dimensionality}") Requires Python >= 3.10 and numpy as a runtime dependency. Verify before relying: - Whether test coverage has improved since the description was written and whether the package is now suitable for mission-critical use. - Exact BSD license variant(s) used, given the unclear license_treatment in metadata. ## Package facts - License: not declared (unclear) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 263.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags physical units and quantities, unit conversion arithmetic, dimensional analysis python, numpy quantities with units, scientific unit handling, units-and-quantities, dimensional-analysis [View on SkillFed](https://skillfed.io/packages/quantities) · [View on PyPI](https://pypi.org/project/quantities/)