Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/addleonel/unitrevpy
This contains common conversions such as units convert of length, temperature, area, volume, time, and weight.
https://github.com/addleonel/unitrevpy
common-conversions numpy python3
Last synced: 5 days ago
JSON representation
This contains common conversions such as units convert of length, temperature, area, volume, time, and weight.
- Host: GitHub
- URL: https://github.com/addleonel/unitrevpy
- Owner: addleonel
- License: mit
- Created: 2020-06-11T22:35:10.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-06-24T23:32:19.000Z (over 2 years ago)
- Last Synced: 2024-10-12T16:40:58.296Z (about 1 month ago)
- Topics: common-conversions, numpy, python3
- Language: Python
- Homepage:
- Size: 37.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:Magnitude | Units
-------------|-------------
|**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:
```python
from unitrevpy import convert
```
or
```python
from unitrevpy.convert import Celsius
```## Example
Using an integer or float argument:
```python
from unitrevpy import convert as c
y = c.Meter(23).to_yard()
m = c.Meter(4500).to_mile()
```
Using list, tuple, or set:
```python
from unitrevpy.convert import Kelvin
kelvin = [23, 20, 16]
celsius = Kelvin(kelvin).to_celsius()
```