--- id: ansys-units version: "0.12.1" license: MIT license_treatment: permissive maintenance: active --- # ansys-units — Pythonic interface for units, unit systems, and unit conversions. License: permissive · Maintenance: active · Downloads: 94.2K/mo ## What it is and what it does PyAnsys Units is a Python library for working with physical quantities—combinations of numerical values and units of measurement. It provides a Quantity class that wraps values with their units, enabling arithmetic operations (addition, subtraction, multiplication, division, exponentiation) while automatically tracking and validating dimensional consistency. The package includes a UnitRegistry for accessing predefined units, a UnitSystem abstraction for switching between measurement systems (SI, imperial, custom), and direct conversion between compatible units. The library is designed for scientific and engineering workflows where dimensional analysis matters. It works with scalar values, lists, and NumPy arrays, and integrates with standard Python math functions. Its modular design allows extending the unit and constant definitions without modifying source code. With complete test coverage and support for Python 3.10 through 3.14, it targets researchers and engineers who need reliable unit handling in calculations. Use it for: - Perform physics calculations with automatic dimensional checking to catch unit mismatches early. - Convert between unit systems (e.g., SI to imperial) in scientific simulations or data pipelines. - Work with NumPy arrays of measurements while preserving and validating their units throughout operations. - Define custom unit systems for domain-specific engineering problems without modifying the library. - Integrate unit-aware quantities into data analysis workflows that mix different measurement standards. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Manages physical quantities with numerical values and units, supporting arithmetic operations, unit conversions, and integration with NumPy arrays. Yes. The package is actively maintained, has low install friction, carries no known vulnerabilities, and uses a permissive MIT license. It solves a real problem—dimensional consistency in numerical code—with a clean API. Install it if you work with physical quantities and want automatic unit tracking; skip it if your calculations never mix units or if you need a heavier symbolic math system. ## Install pip install ansys-units uv add ansys-units poetry add ansys-units ## Installing ansys-units Before you install: Low install friction with only two lightweight runtime dependencies (pyyaml and typing-extensions). Active maintenance with a recent release 59 days ago and current commit activity. License in practice: MIT license permits unrestricted use, modification, and distribution in both open-source and commercial projects with minimal attribution requirements. Quickstart: pip install ansys-units import ansys.units as ansunits from ansys.units.common import m, s volume = 1 * m**3 print(volume.value, volume.units.name) velocity = 10 * m / s print(velocity.to(ansunits.UnitRegistry().km / ansunits.UnitRegistry().hour)) Requires Python 3.10 or later (supports up to 3.14). NumPy is optional but needed for array-based quantities. Verify before relying: - Whether NumPy integration is automatic or requires explicit installation beyond the listed runtime dependencies. - Performance characteristics when working with large arrays or complex unit systems. - Completeness of the bundled physical units and constants relative to domain-specific needs. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 94.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags unit conversion library, physical quantities python, dimensional analysis, unit arithmetic operations, SI units and systems, quantity with units, unit registry, unit-conversion, dimensional-analysis, scientific-computing [View on SkillFed](https://skillfed.io/packages/ansys-units) · [View on PyPI](https://pypi.org/project/ansys-units/)