Easily use and manipulate unit-aware measurements in Python.
Project description
Easily use and manipulate unit-aware measurement objects in Python.
django.contrib.gis.measure has these wonderful ‘Distance’ objects that can be used not only for storing a unit-aware distance measurement, but also for converting between different units and adding/subtracting these objects from one another.
This module not only provides those Distance and Area measurement objects, but also other measurements including:
Energy
Speed
Temperature
Time
Volume
Weight
Example:
>>> from measurement.measures import Weight
>>> weight_1 = Weight(lb=125)
>>> weight_2 = Weight(kg=40)
>>> added_together = weight_1 + weight_2
>>> added_together
Weight(lb=213.184976807)
>>> added_together.kg # Maybe I actually need this value in kg?
96.699
Documentation for python-measurement is available an ReadTheDocs.
Please post issues on Github.
Test status available on Travis-CI.
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 measurement-3.2.1.tar.gz
.
File metadata
- Download URL: measurement-3.2.1.tar.gz
- Upload date:
- Size: 12.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 525393e117c83b2200285e39b550882eecfd69bb05912d0e2ca6c792c931e6e4 |
|
MD5 | bc7f443ede7508338eaeed85d79fb1c7 |
|
BLAKE2b-256 | 1b72d5d2adf583069977369964951266a5529aa8915212ef4582a952d8c59103 |
File details
Details for the file measurement-3.2.1-py3-none-any.whl
.
File metadata
- Download URL: measurement-3.2.1-py3-none-any.whl
- Upload date:
- Size: 17.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4582f22ce01b7b1243e0eeed4a9b8cea90068c89f23b8b8394f1d1b84f95a21 |
|
MD5 | e9cecd92bc6a79386c7a8cc4c5de8d5f |
|
BLAKE2b-256 | 45bd3e6a3388f1b96d2270ef46312ea6dea2ad303f9a040e8f0b6cd45c17a650 |