{ "info": { "author": "David O'Connor", "author_email": "david.alan.oconnor@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3 :: Only", "Topic :: Scientific/Engineering" ], "description": "[![image](https://img.shields.io/pypi/v/siunits.svg)](https://pypi.org/project/siunits/)\n[![image](https://img.shields.io/pypi/l/siunits.svg)](https://pypi.org/project/siunits/)\n[![image](https://img.shields.io/pypi/pyversions/siunits.svg)](https://pypi.org/project/siunits/)\n\n# SI Units\n\nThis is a library used to symbolically manipulate SI units. It comprises a `BaseUnit` type,\nused for base SI units like `kilogram`, `meter` etc, a `DerivedUnit` type,\nfor units derived from them, and a `Composite` type, for when numerical coefficients\nare included. Python version 3.7 or greater is required. There are no dependencies.\n\nThis library is useful for dimensional analysis. It relies on the concept that\nSI units are all composed of varying exponents of 7 base units. We can think \nof all other units as linear combinations of base units.\n\nYou can perform normal multiplication, division, and power operations on units\nprovided by this lib, and between them and `int`s and `floats`. You can check equality,\nbased on the resulting combination of base units.\n\n## Install\n```bash\npip install siunits\n```\nIn Linux, you may need to use something like `pip3 install siunits`, or `python3.7 -m pip install siunits`.\n\n## Examples\n\nA base unit:\n```python\nimport siunits as u\n\nu.kg\n>>> kilogram (kg), mass\n```\n\nA derived unit:\n```python\nu.v\n>>> volt (V), [kg: 1, m: 2, s: -3, A: -1]\n```\n\nMultiplication:\n```python\nu.kg * u.s\n>>> kilogram\u00b7second (kg\u00b7s), [kg: 1, s: 1]\n```\n\nDivision:\n```python\nu.j / u.m**2\n>>> joule / meter\u00b2 (kg\u00b7s\u207b\u00b2), [kg: 1, s: -2]\n\nu.s**2 / u.kg**3\n>>> second\u00b2\u00b7kilogram\u207b\u00b3 (s\u00b2\u00b7kg\u207b\u00b3), [s: 2, kg: -3]\n\n```\n\nWith numerical coefficients:\n```python\n2*u.a**2 * 3*u.v**2\n>>> 6kg\u00b2\u00b7m\u2074\u00b7s\u207b\u2076\n```\n\nEquality testing is based on composition of base units:\n```python\nu.w == u.v * u.a == u.kg * u.m**2 / u.s**3\n>>> True\n```\n\n## Todo\n\n- Infer composite types that match a given custom (eg multiplied) unit\n- Apply arithmetic to quantities as well (eg `energy`, `work` etc), and display them\n- Addition and subtraction\n\n## Scope\n\nThis project doesn't aim to provide conversions with other unit systems, like\n`cgs` and `imperial`, nor does it provide physical constants. For these\ntasks, try [scipy.constants](https://docs.scipy.org/doc/scipy/reference/constants.html).\n\n## Why add another unit library?\n\nThe clean symbolic manipulation this library provides doesn't appear to exist\nin any existing one.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/David-OConnor/si_units", "keywords": "si units dimensional analysis", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "siunits", "package_url": "https://pypi.org/project/siunits/", "platform": "", "project_url": "https://pypi.org/project/siunits/", "project_urls": { "Homepage": "https://github.com/David-OConnor/si_units" }, "release_url": "https://pypi.org/project/siunits/0.0.6/", "requires_dist": null, "requires_python": ">=3.7", "summary": "Perform operations on SI units", "version": "0.0.6" }, "last_serial": 5923334, "releases": { "0.0.3": [ { "comment_text": "", "digests": { "md5": "e059ccc8d814fb82213fb5fde69277f8", "sha256": "203a1b5c97074479734def0817c988574d29d88acd993f7ea576d28aa5a7cafb" }, "downloads": -1, "filename": "siunits-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "e059ccc8d814fb82213fb5fde69277f8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7", "size": 7964, "upload_time": "2019-07-02T13:36:47", "url": "https://files.pythonhosted.org/packages/09/6c/fe71585faf7bfaada4cf054da997cb0ae10fe6696b6b06ed4acb8c469cf6/siunits-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bb5c9fcf3e7a936d922acdcb11fa2603", "sha256": "759c1c747f29513515e1295336790305d502dffbccd17dbe927e6ae6f5aacdc0" }, "downloads": -1, "filename": "siunits-0.0.3.tar.gz", "has_sig": false, "md5_digest": "bb5c9fcf3e7a936d922acdcb11fa2603", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 6505, "upload_time": "2019-07-02T13:36:50", "url": "https://files.pythonhosted.org/packages/55/dc/a4bfc40ffa4f018879c8048bbe59fcb4bfc79d5b14cd95c2409f257c217a/siunits-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "087254ff7e27d5084e6ab5eb7c8e0a28", "sha256": "9c4fb2a6a92ebc66d3790c6bbd2cff97b7a0ef4c483183c184f9819df7caf1d1" }, "downloads": -1, "filename": "siunits-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "087254ff7e27d5084e6ab5eb7c8e0a28", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7", "size": 12820, "upload_time": "2019-07-02T13:46:52", "url": "https://files.pythonhosted.org/packages/34/09/214d81ae27ceaee5b51346d91e1fec06c59659d31d7329661b507fa17c70/siunits-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c6f5c02e35b1a7def3f3e6765ddc55ab", "sha256": "136cac1a3b8203a76b44b401937593b366d43bc95209d8b436be8ce7402a93ba" }, "downloads": -1, "filename": "siunits-0.0.4.tar.gz", "has_sig": false, "md5_digest": "c6f5c02e35b1a7def3f3e6765ddc55ab", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 6509, "upload_time": "2019-07-02T13:46:54", "url": "https://files.pythonhosted.org/packages/a8/44/acb7fd2e63d2adf561f3668552e54f509b7bd0e5b5b0b56be01ab2614d21/siunits-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "04933279111f06229e44b44d5157b81c", "sha256": "68cd19871139e385de049c3281aeb68ee2fbf3b8c3208a997d6019f99b19a5ae" }, "downloads": -1, "filename": "siunits-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "04933279111f06229e44b44d5157b81c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8189, "upload_time": "2019-08-10T11:00:24", "url": "https://files.pythonhosted.org/packages/f5/6d/c39890817fed87376263bebd7a252b1ffb7adbff584b37aedc0a24e6799f/siunits-0.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9dc1820f7eafa244669d0c6a5b39394c", "sha256": "29b8db2998196845b35ef03cbc8cb75cdedcbb2799331b431a0db094f18c8be5" }, "downloads": -1, "filename": "siunits-0.0.5.tar.gz", "has_sig": false, "md5_digest": "9dc1820f7eafa244669d0c6a5b39394c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6622, "upload_time": "2019-08-10T11:00:26", "url": "https://files.pythonhosted.org/packages/4e/8f/86df2f247853c49fb18c590ca0f84ea7616c7dca51aae631fad6439616c0/siunits-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "329320ae207c448e880a865779a3d1f4", "sha256": "962146ed26387b768696a619444c459bf04d3951ab3c4228906df87cd298f05e" }, "downloads": -1, "filename": "siunits-0.0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "329320ae207c448e880a865779a3d1f4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7", "size": 8357, "upload_time": "2019-09-27T04:09:01", "url": "https://files.pythonhosted.org/packages/22/66/ee4a14b29263feee3629dcc00b72755a9b48336f77b73244deda807389af/siunits-0.0.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "04217ef1d6a1d8d06b9407a91dba50b4", "sha256": "649f4910f2eb47c2c5a2b4387c76a99bb241f21947728497aa22ed7b4d9a82fd" }, "downloads": -1, "filename": "siunits-0.0.6.tar.gz", "has_sig": false, "md5_digest": "04217ef1d6a1d8d06b9407a91dba50b4", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 6832, "upload_time": "2019-09-27T04:09:04", "url": "https://files.pythonhosted.org/packages/47/58/afc8be69af36f425b99f87aeb62723bda4e93d25a6bf167e799e409fc516/siunits-0.0.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "329320ae207c448e880a865779a3d1f4", "sha256": "962146ed26387b768696a619444c459bf04d3951ab3c4228906df87cd298f05e" }, "downloads": -1, "filename": "siunits-0.0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "329320ae207c448e880a865779a3d1f4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7", "size": 8357, "upload_time": "2019-09-27T04:09:01", "url": "https://files.pythonhosted.org/packages/22/66/ee4a14b29263feee3629dcc00b72755a9b48336f77b73244deda807389af/siunits-0.0.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "04217ef1d6a1d8d06b9407a91dba50b4", "sha256": "649f4910f2eb47c2c5a2b4387c76a99bb241f21947728497aa22ed7b4d9a82fd" }, "downloads": -1, "filename": "siunits-0.0.6.tar.gz", "has_sig": false, "md5_digest": "04217ef1d6a1d8d06b9407a91dba50b4", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 6832, "upload_time": "2019-09-27T04:09:04", "url": "https://files.pythonhosted.org/packages/47/58/afc8be69af36f425b99f87aeb62723bda4e93d25a6bf167e799e409fc516/siunits-0.0.6.tar.gz" } ] }