skillfed

Pint

Physical quantities module

pint v0.25.3 6.1M downloads/30d#1,965 on PyPI2,769
Permissive license BSD Active released

What it is and what it does

Pint is a Python library for working with physical quantities—numbers paired with units of measurement. It lets you perform arithmetic on quantities (adding meters to centimeters, for example), convert between units, and work with a built-in library of physical units, prefixes, and constants. The library is designed to be modular, so you can extend or replace the unit definitions without touching the source code.

The package integrates cleanly with NumPy arrays and supports NumPy mathematical operations without monkey-patching, meaning you can work with arrays of quantities directly. It also integrates with Pandas DataFrames and the uncertainties package when installed. Pint is dependency-free at its core—it runs on Python 3.11+ with only the standard library—making it lightweight and easy to add to any project.

Use it for:

  • Scientific calculations where you need to track units automatically and catch dimensional mismatches (e.g., physics simulations, engineering computations).
  • Data analysis pipelines that mix different measurement units and need automatic conversion and validation.
  • Building command-line tools or applications that accept user input in various units and normalize them internally.
  • NumPy-based numerical work where array operations must preserve and transform units correctly.
  • Pandas workflows where columns represent measured quantities with different units that need unit-aware operations.

Worth the install?

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

Pint defines, operates on, and converts between physical quantities—combining numerical values with units of measurement—and supports arithmetic operations and unit conversions across a comprehensive built-in unit library.

Yes. Pint is a mature, actively maintained library with no known vulnerabilities, low install friction, and permissive licensing. It solves a real problem—tracking and converting units in calculations—cleanly and without forcing heavy dependencies. Install it if you work with physical quantities, scientific data, or any calculation where mixing units is a concern.

Install

pint on PyPI

pip

pip install pint

uv

uv add pint

poetry

poetry add pint

Installing Pint

Before you install

Low friction: pure Python wheel with only four lightweight runtime dependencies (flexcache, flexparser, platformdirs, typing-extensions). Active maintenance with a recent release 148 days ago and ongoing commits; well-established project since 2012 with 2769 repository stars.

License in practice

BSD permissive license allows free use, modification, and distribution in both open-source and proprietary projects with minimal restrictions.

Quickstart

pip install pint

import pint
ureg = pint.UnitRegistry()
result = 3 * ureg.meter + 4 * ureg.cm
print(result)  # <Quantity(3.04, 'meter')>

Requires Python 3.11 or later.

Verify before relying

  • Performance characteristics when handling very large arrays or complex unit hierarchies.
  • Completeness and accuracy of the default unit definitions relative to domain-specific standards.

Package facts

License BSD (permissive)
Python support supports the current Python release (>=3.11)
Install friction low — pure-Python wheel
Runtime dependencies 4 — flexcache, flexparser, platformdirs, typing-extensions
Maintenance actively maintained — 148 days since the last release
Last repo commit
First released
Downloads 6,136,479/month — #1,965 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pint-0.25.3-py3-none-any.whl

Keywords: conversion, physical, quantities, science, unit

Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIXProgramming Language :: PythonProgramming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Scientific/EngineeringTopic :: Software Development :: Libraries

Tags

unit conversion pythonphysical quantities librarydimensional analysisunit arithmeticscientific units handlingmeasurement unit systemquantity calculations
unit-conversionscientific-computingnumpy-compatible

More Libraries packages