unyt
A package for handling numpy arrays with units
Decision gist · record as of 2026-08-14
Yes. unyt is a mature, actively maintained package with no security issues, low install friction, and a permissive license. It solves a real problem—tracking units in numerical code—that becomes increasingly valuable as data complexity grows. Install it if you work with physical quantities or dimensional data and want to avoid silent unit errors.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Low friction install with a pure-Python implementation depending only on numpy, sympy, and packaging.
- Active maintenance with a recent release and no known vulnerabilities.
License · maintenance · safety
BSD-3-Clause (permissive) — BSD 3-Clause permissive license allows use in commercial and proprietary projects with minimal restrictions; you must include a copy of the license and acknowledge the authors.
last release 2026-01-15 (211 days) · last repo commit 2026-08-03 · 382 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 99,246 downloads/mo, #13,032 on PyPI
Alternatives
Verify before relying
pip install unyt
import unyt as u
import numpy as np
distance = np.array([3.4, 5.8, 7.2]) * u.mile
print(distance.to('km'))- Whether unit conversion accuracy and precision meet domain-specific requirements for your application.
- Performance characteristics when working with very large arrays or frequent unit conversions.
What it is and what it does
unyt is a NumPy array subclass that carries unit information alongside numerical data. Instead of writing plain NumPy arrays and relying on documentation or convention to track what units apply, you attach units directly to the array: `distance = [3.4, 5.8, 7.2] * u.mile` then convert or inspect units as needed. The package handles unit arithmetic, conversion between compatible units, and propagation through operations.
It's built entirely in Python on top of numpy and sympy, with no compiled dependencies or external tools required. The design keeps units transparent—operations on unitful arrays generally preserve or correctly combine units—so you can write scientific code that's both explicit about dimensions and readable.
Use it for
- Track physical quantities in simulations or data analysis without losing dimensional information.
- Convert between unit systems (e.g., miles to kilometers) without manual lookup tables.
- Catch unit mismatches early by letting NumPy operations fail when incompatible units are combined.
- Document and enforce dimensional consistency in scientific workflows and research code.
- Build libraries that accept and return quantities with explicit units, reducing API ambiguity.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
unyt is a mature, actively maintained package with no security issues, low install friction, and a permissive license. It solves a real problem—tracking units in numerical code—that becomes increasingly valuable as data complexity grows. Install it if you work with physical quantities or dimensional data and want to avoid silent unit errors.
Install
unyt on PyPI
Before you install
Low friction install with a pure-Python implementation depending only on numpy, sympy, and packaging. Active maintenance with a recent release and no known vulnerabilities.
Requires Python 3.10 or later.
License in practice
BSD 3-Clause permissive license allows use in commercial and proprietary projects with minimal restrictions; you must include a copy of the license and acknowledge the authors.
Quickstart
pip install unyt
import unyt as u
import numpy as np
distance = np.array([3.4, 5.8, 7.2]) * u.mile
print(distance.to('km'))
Verify before relying
- Whether unit conversion accuracy and precision meet domain-specific requirements for your application.
- Performance characteristics when working with very large arrays or frequent unit conversions.
Package facts
| License | BSD-3-Clause permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagesnumpysympypackaging |
| Maintenance | Actively maintained 211 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 99,246 / month, #13,032 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Science/ResearchNatural Language :: EnglishProgramming Language :: Python :: 3Programming Language :: Python :: Implementation :: CPython |
Evidence: unyt-3.1.0-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 › “numpy arrays with units”
- unytAttaches units to NumPy arrays and provides unit conversion, so you…
- ansys-unitsManages physical quantities with numerical values and units,…
- PintPint defines, operates on, and converts between physical…
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 pint-xarray · Pint · typedunits · ansys-units · ucumvert · quantities · Pint-Pandas · quantulum3 · hepunits · binary