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
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
Built Distribution
File details
Details for the file unitrevpy-0.0.4.tar.gz
.
File metadata
- Download URL: unitrevpy-0.0.4.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63419c6e5663550cf4018321a0195e3de79aa56f4dd2310b3a856f9d58e6176c |
|
MD5 | 1dbd693acb909a02a193698645dff6bc |
|
BLAKE2b-256 | a7ca328cd74f1c9820338091692160dea9f1426801fc3aba77f7b8e9096b57b6 |
File details
Details for the file unitrevpy-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: unitrevpy-0.0.4-py3-none-any.whl
- Upload date:
- Size: 12.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6b98bfff8c44d3ca514ba5a154175c7203614ed92a9bec9a47181cb4064a79b |
|
MD5 | bee8e72aadfeec988bb06509e3426f90 |
|
BLAKE2b-256 | 3d41145f50d636519fee1f0dc99c624727b33679d1cfbd7595b43681b1fbbd7f |