--- id: pint version: "0.25.3" license: BSD license_treatment: permissive maintenance: active --- # Pint — Physical quantities module License: permissive · Maintenance: active · Downloads: 6.1M/mo ## 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 above — 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 pip install pint uv add pint 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) # 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_current - Install friction: low - Maintenance: active - Downloads: 6.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags unit conversion python, physical quantities library, dimensional analysis, unit arithmetic, scientific units handling, measurement unit system, quantity calculations, unit-conversion, scientific-computing, numpy-compatible [View on SkillFed](https://skillfed.io/packages/pint) · [View on PyPI](https://pypi.org/project/pint/)