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
File details
Details for the file measurement-1.7.3.tar.gz
.
File metadata
- Download URL: measurement-1.7.3.tar.gz
- Upload date:
- Size: 22.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7fae680d1bc6193e8ebf89897912e73463faa25d0c811a31e215ea36a6e001d |
|
MD5 | 09e4141b806ea7e0bf2d51e2ed1b83c8 |
|
BLAKE2b-256 | c8ad673c905e3b9c4cd6e729b8d12cf5bb9a59fe4ea556b0c9d42fbdc7134257 |