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
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 measurement-3.2.2.tar.gz.
File metadata
- Download URL: measurement-3.2.2.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 |
a16fe5a8bd72f3682285e87a0abe880d647bcf6e3bf9cc727eeb261d6163c07e
|
|
| MD5 |
6af8cd2bd6ba7c0f774e4c948e53899c
|
|
| BLAKE2b-256 |
1b38b7ee4772e808071211fa99d3980789c97bdc89cd1df76bcd291ce84d2fe5
|
File details
Details for the file measurement-3.2.2-py3-none-any.whl.
File metadata
- Download URL: measurement-3.2.2-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 |
9e51ed130bd077f3bfe563959e1b1d7d5f2f4a51055c94625418db47464ffd78
|
|
| MD5 |
52f9092f29667223868add036c70275b
|
|
| BLAKE2b-256 |
f1867df529fde981b67105efbfa28950eb67e25f1e1bbbf132a57098b6c9f16e
|