A light-weight wrapper around pint.
Project description
koozie
koozie is a light-weight wrapper around pint. The intent is to provide much of the functionality without worrying about the setup. It uses quantities internally, but its functions only return floats. This approach reflects the opinion that all calculations should be performed in Standard base SI units, and any conversions can happen via pre- or post-processing for usability. This minimizes additional operations in performance critical code.
koozie also defines a few convenient aliases for different units. See the source code for details. A list of other available units is defined in pint's default units definition file.
There are three public functions in koozie:
fr_u(value, from_units)
: Convert a value from given units to base SI unitsto_u(value, to_units)
: Convert a value from base SI units to given unitsconvert(value, from_units, to_units)
: Convert from any units to another units of the same dimension
Example usage can be found in the test file.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.