Skip to main content

This contains common unit conversions

Project description

unitrevpy

Summary

unitrevpy is a package that contains common unit conversions such as length, temperature, area, volume, time, and weight.

What units does it contain?

Specifically contains:

  • Lenght

       Meter, Yard, Mile, Foot, Inch, and Light Year.

  • Temperature

       Celsius, Kelvin, and Fahrenheit

  • Area

       Square meter, Hectare, Square Mile, Square Yard, Square Foot, Square Inch, and Acre.

  • Volume

       Cubic Meter, Cubic Kilometer, Cubic Centimeter, Cubic Millimeter, Liter, Milliliter, US Gallon, US Quart, US Pint, US Cup, US Fluid Ounce, US Table Spoon, US Tea Spoon, Imperial Gallon, Imperial Quart, Imperial Pint, Imperial Fluid Ounce, Imperial Table Spoon, Imperial Tea Spoon, Cubic Mile, Cubic Yard, cubic Foot, and Cubic Inch.

  • Time

       Second, Minute, Hour, Day, Week, Month, and Year.

  • Weight

       Kilogram, Gram, Millimeter, Metric Ton, Long Ton, Short Ton, Pound, Ounce, Carat, and Atomic Mass Unit (Dalton).

installation

pip install unitrevpy

or

python -m pip install unitrevpy

To import it into a script:

from unitrevpy import convert

or

from unitrevpy.convert import Celsius

Example

Using an integer or float argument:

from unitrevpy import convert as c
y = c.Meter(23).to_yard()
m = c.Meter(4500).to_mile()

Using list, tuple, or set:

from unitrevpy.convert import Kelvin
kelvin = [23, 20, 16]
celsius = Kelvin(kelvin).to_celsius()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unitrevpy-0.0.4.tar.gz (10.4 kB view hashes)

Uploaded Source

Built Distribution

unitrevpy-0.0.4-py3-none-any.whl (12.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page