A package for units.
Project description
AllYourUnitAreBelongToUs
Installation
pip install ayuabtu
Using
Creating quantities
Creating a quantity with a given unit:
>>> from ayuabtu.quantities import Length
>>> from ayuabtu.units import LengthUnit
>>> Length(2, LengthUnit.METER)
2 m
or you can use the unit specific factory method:
>>> from ayuabtu.quantities import Length
>>> Length.FromMeters(2)
2 m
Converting units
>>> from ayuabtu.quantities import Length
>>> from ayuabtu.units import LengthUnit
>>> Length(2, LengthUnit.METER)
>>> distance_metric = Length.FromMeters(2)
>>> distance_metric.to_unit(LengthUnit.FOOT)
6.561679790026246 ft
Custom Units
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ayuabtu-0.0.1.tar.gz
(6.0 kB
view hashes)