corva-unit-converter


Namecorva-unit-converter JSON
Version 0.5.0 PyPI version JSON
download
home_pagehttps://github.com/corva-ai/corva-convert-units-py
SummaryUnit converter for O&G(and other) units
upload_time2024-07-30 15:21:13
maintainerNone
docs_urlNone
authorYuliya Klimushina
requires_python<4.0,>=3.8
licenseMIT
keywords corva unit converter
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Units Converter

Library for converting between quantities in different units(including units specific to O&G).

This is a python version of the existing javascript app.
Credit goes to the creator and contributors of the original version https://github.com/corva-ai/corva-convert-units,
which is a fork of https://github.com/convert-units/convert-units.

# Installation

```shell
pip install corva-unit-converter
```

# Usage:

Imperial to metric:

    from corva_unit_converter.converter import Converter
    converter = Converter()
    length_meters = converter.convert(unit_from="ft", unit_to="m", value=1)

Metric to imperial:

    from corva_unit_converter.converter import Converter
    converter = Converter()
    torque_ft_lbf = converter.convert(unit_from="Nm", unit_to="ft-lbf", value=1)

Metric to metric:

    from corva_unit_converter.converter import Converter
    converter = Converter()
    mass_grams = converter.convert(unit_from="kg", unit_to="g", value=1)


# Contribution

1. Cover your changes with unit tests.
2. Bump version in src/version.py if you want your changes to be released.


# Testing

1. Create virtualenv via your favourite tool, for example 
```shell
python3 -m venv venv
source venv/bin/activate
```
2. Install all requirements:
```shell
pip install -r requirements.txt && pip install -r requirements-test.txt
```
3. Run tests with coverage:
```shell
make coverage
```
or tests without coverage:
```shell
make test
```
Linters are available through
```shell
make lint
```

# License
This project is licensed under the terms of the MIT license.

Copyright (c) 2013-2017 Ben Ng and Contributors, http://benng.me

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/corva-ai/corva-convert-units-py",
    "name": "corva-unit-converter",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": "corva, unit converter",
    "author": "Yuliya Klimushina",
    "author_email": "yuliya.klimushina@corva.ai",
    "download_url": "https://files.pythonhosted.org/packages/39/74/f5a70d5b7de6c246c79957775a3e1af39a748dbaf42c3fa5a8d01d668827/corva_unit_converter-0.5.0.tar.gz",
    "platform": null,
    "description": "# Units Converter\n\nLibrary for converting between quantities in different units(including units specific to O&G).\n\nThis is a python version of the existing javascript app.\nCredit goes to the creator and contributors of the original version https://github.com/corva-ai/corva-convert-units,\nwhich is a fork of https://github.com/convert-units/convert-units.\n\n# Installation\n\n```shell\npip install corva-unit-converter\n```\n\n# Usage:\n\nImperial to metric:\n\n    from corva_unit_converter.converter import Converter\n    converter = Converter()\n    length_meters = converter.convert(unit_from=\"ft\", unit_to=\"m\", value=1)\n\nMetric to imperial:\n\n    from corva_unit_converter.converter import Converter\n    converter = Converter()\n    torque_ft_lbf = converter.convert(unit_from=\"Nm\", unit_to=\"ft-lbf\", value=1)\n\nMetric to metric:\n\n    from corva_unit_converter.converter import Converter\n    converter = Converter()\n    mass_grams = converter.convert(unit_from=\"kg\", unit_to=\"g\", value=1)\n\n\n# Contribution\n\n1. Cover your changes with unit tests.\n2. Bump version in src/version.py if you want your changes to be released.\n\n\n# Testing\n\n1. Create virtualenv via your favourite tool, for example \n```shell\npython3 -m venv venv\nsource venv/bin/activate\n```\n2. Install all requirements:\n```shell\npip install -r requirements.txt && pip install -r requirements-test.txt\n```\n3. Run tests with coverage:\n```shell\nmake coverage\n```\nor tests without coverage:\n```shell\nmake test\n```\nLinters are available through\n```shell\nmake lint\n```\n\n# License\nThis project is licensed under the terms of the MIT license.\n\nCopyright (c) 2013-2017 Ben Ng and Contributors, http://benng.me\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Unit converter for O&G(and other) units",
    "version": "0.5.0",
    "project_urls": {
        "Homepage": "https://github.com/corva-ai/corva-convert-units-py"
    },
    "split_keywords": [
        "corva",
        " unit converter"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4aecd2cb6d1a32d7ff9a36beb64efe4cdb1584a545060c95ff78a078df99dbac",
                "md5": "b985e2fc95f43f606f295a7f8464806b",
                "sha256": "6fd3e5708e3d7845d04435a55c7fbf5a6c96bfded44af8a3677f9f59583c2822"
            },
            "downloads": -1,
            "filename": "corva_unit_converter-0.5.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b985e2fc95f43f606f295a7f8464806b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 27642,
            "upload_time": "2024-07-30T15:21:12",
            "upload_time_iso_8601": "2024-07-30T15:21:12.746306Z",
            "url": "https://files.pythonhosted.org/packages/4a/ec/d2cb6d1a32d7ff9a36beb64efe4cdb1584a545060c95ff78a078df99dbac/corva_unit_converter-0.5.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3974f5a70d5b7de6c246c79957775a3e1af39a748dbaf42c3fa5a8d01d668827",
                "md5": "f05022bd18dc53c0fc9a4967bf19f686",
                "sha256": "6110c6dacc771e89d0539a299b3d93e5e279ac0a7a6bfdc4949f940f5374d4ae"
            },
            "downloads": -1,
            "filename": "corva_unit_converter-0.5.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f05022bd18dc53c0fc9a4967bf19f686",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 20576,
            "upload_time": "2024-07-30T15:21:13",
            "upload_time_iso_8601": "2024-07-30T15:21:13.720198Z",
            "url": "https://files.pythonhosted.org/packages/39/74/f5a70d5b7de6c246c79957775a3e1af39a748dbaf42c3fa5a8d01d668827/corva_unit_converter-0.5.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-30 15:21:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "corva-ai",
    "github_project": "corva-convert-units-py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "corva-unit-converter"
}
        
Elapsed time: 1.28357s