Module to convert unit of area from one system of units to another.
Project description
Area Unit Conversion
Python module to convert unit of area from one system of units to another.
Introduction
This package was created for real estate business purposes. The availables units of length are the most commonly used in industry.
Availables units:
Abbrev | Unit "EN" | Unit "ES" | value |
---|---|---|---|
km² | Square Kilometers | Kilómetros cuadrados | km2 |
m² | Square Meters | Metros cuadrados | m2 |
mi² | Square Miles | Millas cuadradas | mi2 |
yd² | Square Yard | Yardas cuadradas | yd2 |
ft² | Square Feet | Pies cuadrados | ft2 |
in² | Square Inches | Pulgadas cuadradas | in2 |
ha | Hectares | Hectáreas | ha |
ac | Acres | Acres | ac |
Installation
$ pip install area_unit_conversion
Usage
convert
Converts unit of area from one system of units to another
Argument | Type | Default | Description |
---|---|---|---|
from_unit_type | str | None | Original system of unit area |
to_unit_type | str | None | Desired system of unit area |
value | float | 0 | Area value to convert |
import area_unit_conversion
area_unit_conversion.convert('m2','ha',10000)
# Return 1
get_units_of_length
Lists available units of length
Argument | Type | Default | Description |
---|---|---|---|
lang | str | "en" | iso code of language |
Options: "es" | "en"
import area_unit_conversion
area_unit_conversion.get_units_of_length()
# Return
[
{
'abbreviation': 'km²',
'value': 'km2',
'name': 'Square Kilometers'
},{
'abbreviation': 'm²',
'value': 'm2',
'name': 'Square Meters'
},{
'abbreviation': 'mi²',
'value': 'mi2',
'name': 'Square Miles'
},
etc. , etc.
}
]
Test
Running tests:
$ pytest
Checking the package installs correctly with different Python versions and interpreters.
Tested with python3.6, python3.7, python3.8, python3.9 and python3.10 versions:
$ tox
Contributing
Contributions are welcome - submit an issue/pull request.
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 area_unit_conversion-1.0.tar.gz
.
File metadata
- Download URL: area_unit_conversion-1.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.10.1 Darwin/21.2.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86c8d413e3bcf12949fcd874aea3b2cc1556bd3fcd86c9ec02d20b8acadc0989 |
|
MD5 | 58a5701dbc3ef0639684cd2b73ad1a33 |
|
BLAKE2b-256 | 421c3b124351b0d0957ddb9ec9574b2430f0e21cc9815daffcf538f3600e744b |
File details
Details for the file area_unit_conversion-1.0-py3-none-any.whl
.
File metadata
- Download URL: area_unit_conversion-1.0-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.10.1 Darwin/21.2.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cb0023aa4ea4f7ed01db88d74ff387b5e6042c1cc058528ad45923d440e669d |
|
MD5 | 94403813853daa2684d07efd92b6c937 |
|
BLAKE2b-256 | 288d80275232ce19e11689412bfacff1b60d1e31aaeea58478378491b7174f4f |