AnyUnit - Universal unit converter
Project description
AnyUnit - Universal unit converter
Simple and convenient library for converting physical units.
Installation
pip install anyunit
Examples
Convert length
from anyunit import convert_length
result = convert_length(1, "kilometer", "meter")
print(result) # 1000.0
Convert weight
from anyunit import convert_weight
result = convert_weight(1, "kilogram", "gram")
print(result) # 1000.0
Convert area
from anyunit import convert_area
result = convert_area(1, "kilometer", "mile")
print(result) # 0.38610215859253505
Convert volume
from anyunit import convert_volume
result = convert_volume(1, "liter", "gallon")
print(result) # 0.26417217685798894
Get all units
from anyunit import getAllUnits
result = getAllUnits()
print(result) # {'LENGTH': ['meter', 'kilometer', ... ], 'WEIGHT': ['kilogram', 'gram', ... ], ...}
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
anyunit-0.1.4.tar.gz
(4.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file anyunit-0.1.4.tar.gz.
File metadata
- Download URL: anyunit-0.1.4.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d373501e5c447fdb73415880b1e2b1980e44d1db06088e6d3450c4fb35df84fa
|
|
| MD5 |
6f1e0cade55e92618c0687629c7380d6
|
|
| BLAKE2b-256 |
f985f66fda76b95d0f05e8690b7822efab4073081e5c3e05d8808921dd6c0ec3
|
File details
Details for the file anyunit-0.1.4-py3-none-any.whl.
File metadata
- Download URL: anyunit-0.1.4-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9051ac8db02e80e3a4636990ab45eb5c2991176c8f01b025b590237841e049b
|
|
| MD5 |
7b62d958754326eadbed6244761f49b5
|
|
| BLAKE2b-256 |
c6fad60bec580b062dd066c86ae6ba71d3f84123f84778bd047fb66339df1998
|