measurement


Namemeasurement JSON
Version 3.2.2 PyPI version JSON
download
home_page
SummaryEasily use and manipulate unit-aware measurements in Python.
upload_time2023-01-10 16:41:42
maintainer
docs_urlNone
author
requires_python>=3.7
license
keywords measurement
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. image:: https://travis-ci.org/coddingtonbear/python-measurement.svg?branch=master
   :target: https://travis-ci.org/coddingtonbear/python-measurement

Easily use and manipulate unit-aware measurement objects in Python.

`django.contrib.gis.measure <https://github.com/django/django/blob/master/django/contrib/gis/measure.py>`_
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:

.. code-block:: python

   >>> 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

.. warning::
   Measurements are stored internally by converting them to a
   floating-point number of a (generally) reasonable SI unit.  Given that 
   floating-point numbers are very slightly lossy, you should be aware of
   any inaccuracies that this might cause.

   TLDR: Do not use this in
   `navigation algorithms guiding probes into the atmosphere of extraterrestrial worlds <http://en.wikipedia.org/wiki/Mars_Climate_Orbiter>`_.

- Documentation for python-measurement is available an
  `ReadTheDocs <https://python-measurement.readthedocs.org/>`_.
- Please post issues on
  `Github <https://github.com/coddingtonbear/python-measurement/issues>`_.
- Test status available on
  `Travis-CI <https://travis-ci.org/coddingtonbear/python-measurement>`_.



.. image:: https://d2weczhvl823v0.cloudfront.net/coddingtonbear/python-measurement/trend.png
   :alt: Bitdeli badge
   :target: https://bitdeli.com/free



            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "measurement",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "measurement",
    "author": "",
    "author_email": "Adam Coddington <me@adamcoddington.net>, Johannes Maron <johannes@maron.family>",
    "download_url": "https://files.pythonhosted.org/packages/1b/38/b7ee4772e808071211fa99d3980789c97bdc89cd1df76bcd291ce84d2fe5/measurement-3.2.2.tar.gz",
    "platform": null,
    "description": ".. image:: https://travis-ci.org/coddingtonbear/python-measurement.svg?branch=master\n   :target: https://travis-ci.org/coddingtonbear/python-measurement\n\nEasily use and manipulate unit-aware measurement objects in Python.\n\n`django.contrib.gis.measure <https://github.com/django/django/blob/master/django/contrib/gis/measure.py>`_\nhas these wonderful 'Distance' objects that can be used not only for storing a\nunit-aware distance measurement, but also for converting between different\nunits and adding/subtracting these objects from one another.\n\nThis module not only provides those Distance and Area measurement\nobjects, but also other measurements including:\n\n- Energy\n- Speed\n- Temperature\n- Time\n- Volume\n- Weight\n\nExample:\n\n.. code-block:: python\n\n   >>> from measurement.measures import Weight\n   >>> weight_1 = Weight(lb=125)\n   >>> weight_2 = Weight(kg=40)\n   >>> added_together = weight_1 + weight_2\n   >>> added_together\n   Weight(lb=213.184976807)\n   >>> added_together.kg  # Maybe I actually need this value in kg?\n   96.699\n\n.. warning::\n   Measurements are stored internally by converting them to a\n   floating-point number of a (generally) reasonable SI unit.  Given that \n   floating-point numbers are very slightly lossy, you should be aware of\n   any inaccuracies that this might cause.\n\n   TLDR: Do not use this in\n   `navigation algorithms guiding probes into the atmosphere of extraterrestrial worlds <http://en.wikipedia.org/wiki/Mars_Climate_Orbiter>`_.\n\n- Documentation for python-measurement is available an\n  `ReadTheDocs <https://python-measurement.readthedocs.org/>`_.\n- Please post issues on\n  `Github <https://github.com/coddingtonbear/python-measurement/issues>`_.\n- Test status available on\n  `Travis-CI <https://travis-ci.org/coddingtonbear/python-measurement>`_.\n\n\n\n.. image:: https://d2weczhvl823v0.cloudfront.net/coddingtonbear/python-measurement/trend.png\n   :alt: Bitdeli badge\n   :target: https://bitdeli.com/free\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Easily use and manipulate unit-aware measurements in Python.",
    "version": "3.2.2",
    "split_keywords": [
        "measurement"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f1867df529fde981b67105efbfa28950eb67e25f1e1bbbf132a57098b6c9f16e",
                "md5": "52f9092f29667223868add036c70275b",
                "sha256": "9e51ed130bd077f3bfe563959e1b1d7d5f2f4a51055c94625418db47464ffd78"
            },
            "downloads": -1,
            "filename": "measurement-3.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "52f9092f29667223868add036c70275b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 17726,
            "upload_time": "2023-01-10T16:41:40",
            "upload_time_iso_8601": "2023-01-10T16:41:40.600449Z",
            "url": "https://files.pythonhosted.org/packages/f1/86/7df529fde981b67105efbfa28950eb67e25f1e1bbbf132a57098b6c9f16e/measurement-3.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1b38b7ee4772e808071211fa99d3980789c97bdc89cd1df76bcd291ce84d2fe5",
                "md5": "6af8cd2bd6ba7c0f774e4c948e53899c",
                "sha256": "a16fe5a8bd72f3682285e87a0abe880d647bcf6e3bf9cc727eeb261d6163c07e"
            },
            "downloads": -1,
            "filename": "measurement-3.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "6af8cd2bd6ba7c0f774e4c948e53899c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 12524,
            "upload_time": "2023-01-10T16:41:42",
            "upload_time_iso_8601": "2023-01-10T16:41:42.213808Z",
            "url": "https://files.pythonhosted.org/packages/1b/38/b7ee4772e808071211fa99d3980789c97bdc89cd1df76bcd291ce84d2fe5/measurement-3.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-10 16:41:42",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "measurement"
}
        
Elapsed time: 0.04001s