Logo

A performant, verbose and generic physical unit system.

Static Badge Static Badge

© 2026 Patrick Müller. All rights reserved.

API Doc

Modules

qunits is split into three submodules.

  • dimension   Contains the dimension definitions.
  • registry   Contains the unit registry u.
  • unit   Contains the Unit and the Quantity classes.

All features can be accessed with the following imports.

from qunits import Quantity, Unit, u

Registry

The unit registry u contains many predefined units, including prefixes, such as kilo and milli. Depending on the unit, the prefixes extend from $10^{-30}$ to $10^{30}$.

Units

Physical units are defined by the Unit class.

Quantities

Numerical objects with physical units are defined by the Quantity class.