unit-convert


Nameunit-convert JSON
Version 1.2.0 PyPI version JSON
download
home_pagehttps://github.com/huntfx/unit-convert
SummaryEasy way of converting units.
upload_time2024-02-27 13:08:36
maintainer
docs_urlNone
authorPeter Hunt
requires_python>=2.5
licenseMIT
keywords unit convert conversion
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # unit-convert
Easily convert units to different quantities.

For conveniance, abbreviations are accepted, where an attempt will be made to calculate the type based on the other inputs (eg. "m" can evaluate as either "minute" or "metre").

> **This library is deprecated**: A recommendation is to use [pint](https://github.com/hgrecco/pint) instead.


## Example Usage
```python
>>> from unit_convert import UnitConvert

# Yards + kilometres to miles
>>> UnitConvert(yards=136.23, kilometres=60)['miles']
37.35976780046479

# Bytes to terabytes
>>> UnitConvert('b', 19849347813875, 'megabytes', 512)['tb']
18.053364951617368

# List available conversions
>>> UnitConvert(metres=1).keys()
['nm', 'nanometres', 'μm', 'micrometres', 'mm', 'millimetres', 'cm', 'centimetres', 'i', 'inches', 'ft', 'feet', 'm', 'metres', 'meters', 'yd', 'yards', 'km', 'kilometres', 'kilometers', 'miles', 'lightyears', 'au', 'astronomical_units', 'parsec']
```

Data size, time, distance, mass and temperatures are supported.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/huntfx/unit-convert",
    "name": "unit-convert",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=2.5",
    "maintainer_email": "",
    "keywords": "unit,convert,conversion",
    "author": "Peter Hunt",
    "author_email": "peterh@blue-zoo.co.uk",
    "download_url": "https://files.pythonhosted.org/packages/03/0d/b19f969cf958cdaff72697cd6e89d5f6d03e396f5b06fa726cd44068d78d/unit-convert-1.2.0.tar.gz",
    "platform": null,
    "description": "# unit-convert\r\nEasily convert units to different quantities.\r\n\r\nFor conveniance, abbreviations are accepted, where an attempt will be made to calculate the type based on the other inputs (eg. \"m\" can evaluate as either \"minute\" or \"metre\").\r\n\r\n> **This library is deprecated**: A recommendation is to use [pint](https://github.com/hgrecco/pint) instead.\r\n\r\n\r\n## Example Usage\r\n```python\r\n>>> from unit_convert import UnitConvert\r\n\r\n# Yards + kilometres to miles\r\n>>> UnitConvert(yards=136.23, kilometres=60)['miles']\r\n37.35976780046479\r\n\r\n# Bytes to terabytes\r\n>>> UnitConvert('b', 19849347813875, 'megabytes', 512)['tb']\r\n18.053364951617368\r\n\r\n# List available conversions\r\n>>> UnitConvert(metres=1).keys()\r\n['nm', 'nanometres', '\u00ce\u00bcm', 'micrometres', 'mm', 'millimetres', 'cm', 'centimetres', 'i', 'inches', 'ft', 'feet', 'm', 'metres', 'meters', 'yd', 'yards', 'km', 'kilometres', 'kilometers', 'miles', 'lightyears', 'au', 'astronomical_units', 'parsec']\r\n```\r\n\r\nData size, time, distance, mass and temperatures are supported.\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Easy way of converting units.",
    "version": "1.2.0",
    "project_urls": {
        "Download": "https://github.com/huntfx/unit-convert/archive/1.2.0.tar.gz",
        "Homepage": "https://github.com/huntfx/unit-convert",
        "Issues": "https://github.com/huntfx/unit-convert/issues",
        "Source": "https://github.com/huntfx/unit-convert"
    },
    "split_keywords": [
        "unit",
        "convert",
        "conversion"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "030db19f969cf958cdaff72697cd6e89d5f6d03e396f5b06fa726cd44068d78d",
                "md5": "536421169f5a15ae77f0119f07d51540",
                "sha256": "a9ba2af984a28f0bf55dfcb1f935eb9b6a0d9f94de650cf6b6b623f420802725"
            },
            "downloads": -1,
            "filename": "unit-convert-1.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "536421169f5a15ae77f0119f07d51540",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=2.5",
            "size": 5741,
            "upload_time": "2024-02-27T13:08:36",
            "upload_time_iso_8601": "2024-02-27T13:08:36.491866Z",
            "url": "https://files.pythonhosted.org/packages/03/0d/b19f969cf958cdaff72697cd6e89d5f6d03e396f5b06fa726cd44068d78d/unit-convert-1.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-27 13:08:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "huntfx",
    "github_project": "unit-convert",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "unit-convert"
}
        
Elapsed time: 0.23924s