pyxx.units#
Objects for performing unit conversions
The pyxx.units module provides unit conversion capabilities. It
allows users to define customized systems of units and add associated,
arbitrary units and convert quantities between such units.
Note
For more information on terminology definitions and a conceptual overview of units and systems of units, refer to the Unit Conversion Concepts page.
Unit Converters#
These classes handle unit conversions at the “highest” level, providing a simple-to-use interface to convert units, specified as strings. Most of the lower-level details of parsing units and performing unit conversions are abstracted away from the user for simplicity.

|
Data structure for storing units and performing unit conversions |
|
Data structure for storing information about a unit in a unit converter |
A unit converter using the SI system of units, pre-filled with common units |
Systems of Units#
The classes in this section are intended to represent a system of units, which must be defined prior to setting up custom units or performing unit conversions.

|
Base class representing a system of units |
|
Class representing the SI system of units |
Units#
The classes in this section can be used to define custom units associated with a given system of units.

|
Base class for representing a unit |
|
Class for representing units with linear transformations to/from the base units |
|
Class for representing units with linear transformations to/from the base units and using the International System of Units (SI) |
|
Options for defining what happens when a |
Unit-Parsing#
The objects in this section can be used to parse strings containing units (such
as 'kg/m/(s*m^2)'), separating the component units in the string. This is
an essential precursor to performing unit conversions with complex units.
|
Parses a string of simple or compound units, separating it into fully-simplified component units |