Skip to main content

Easily use and manipulate unit-aware measurements in Python

Project description

https://travis-ci.org/coddingtonbear/python-measurement.png?branch=master

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.

Bitdeli badge

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

measurement-1.7.tar.gz (22.0 kB view details)

Uploaded Source

File details

Details for the file measurement-1.7.tar.gz.

File metadata

  • Download URL: measurement-1.7.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for measurement-1.7.tar.gz
Algorithm Hash digest
SHA256 7f8ca8b17cc75a112d94ddbca600fc936e90eac75ddabcf8e26eaa2ea14fa4cc
MD5 642af73166af59107f8f5e0cae2b0da8
BLAKE2b-256 9f56bcd4b3386fc6003dde4fb7527f7237e2b5f1808ce293d938ea4e914a85a1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page