quantities
Support for physical quantities with units, based on numpy
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python >= 3.10 and numpy as a runtime dependency.
- 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 · maintenance · safety
(unclear) — 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.
last release 2026-01-16 (210 days) · last repo commit 2026-05-13 · 219 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 263,593 downloads/mo, #8,354 on PyPI
Alternatives
Verify before relying
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}")- 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.
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 on this page. Verify before relying on it.
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
quantities on PyPI
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.
Requires Python >= 3.10 and numpy as a runtime dependency.
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}")
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 the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagenumpy |
| Maintenance | Actively maintained 210 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 263,593 / month, #8,354 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: End Users/DesktopIntended Audience :: Science/ResearchOperating System :: OS IndependentProgramming Language :: PythonTopic :: EducationTopic :: Scientific/Engineering |
Evidence: quantities-0.16.4-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “physical units and quantities”
- quantitiesQuantities handles arithmetic and unit conversions for physical…
- PintPint defines, operates on, and converts between physical…
- Pint-PandasPint-Pandas adds physical unit support to pandas DataFrames, allowing…
Give your agent the search over MCP, or paste the wish link into any chat.
More Scientific/Engineering packages
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
pandas provides fast, flexible data structures (Series and DataFrame) for loading, cleaning, transforming, and analyzing labeled or relational data in Python.
scipy provides numerical algorithms for mathematics, science, and engineering—including optimization, integration, linear algebra, Fourier transforms, signal and image processing, and ODE solvers—built on numpy arrays.
scikit-learn provides a comprehensive Python library for supervised and unsupervised machine learning, including classification, regression, clustering, dimensionality reduction, and model evaluation tools built on NumPy and SciPy.
Install it if you need to train, evaluate, or deploy supervised or unsupervised learning models.
dill extends Python's pickle module to serialize and deserialize a much wider range of Python objects, including functions, lambdas, classes, and interpreter sessions, to byte streams for storage or network transmission.
Multiprocess is an enhanced fork of Python's standard multiprocessing library that uses dill for better serialization, allowing you to spawn processes with a threading-like API and share complex objects between them.
Install it if you use multiprocessing and encounter pickle serialization limits with lambdas or complex objects.
See also isqx · Pint · typedunits · quantulum3 · ansys-units · measurement · Pint-Pandas · pint-xarray · unyt · hepunits