_images/logo.svg

A Python Units Wizard that streamlines work with physical quantities.#

Install it#

conda install -c uibcdf pyunitwizard

Use it#

PyUnitWizard provides a unified API to work with physical quantities across different unit libraries (for example Pint, unyt, OpenMM units, Astropy units, physipy, and quantities).

import pyunitwizard as puw

puw.configure.load_library(["pint"])
distance = puw.quantity(1.0, "nanometer")
distance_in_angstrom = puw.convert(distance, to_unit="angstrom")
print(puw.to_string(distance_in_angstrom))

What happens here:

  • quantities are constructed with one public API;

  • conversion is delegated to the configured backend;

  • output can be normalized for downstream interoperability.

Why adopt now#

  • Reduce integration friction when users pass quantities from different unit backends.

  • Make boundary-level unit checks explicit and reproducible in scientific workflows.

  • Keep downstream interoperability stable through consistent conversion and standardization.

Ecosystem proof#

PyUnitWizard is part of the current UIBCDF interoperability stack:

Start with the User Guide and then continue with the Developer Guide if you are contributing to PyUnitWizard itself.