# si-units
[![documentation](https://img.shields.io/badge/docs-github--pages-blue)](https://itt-ustutt.github.io/quantity/index.html)
[![PyPI version](https://badge.fury.io/py/si_units.svg)](https://badge.fury.io/py/si_units)
Representation of quantities with SI units.
The package is written with flexibility in mind and is able to represent arbitrarily complex units.
In addition to simple scalar quantities, it can be used to decorate any complex data type (numpy arrays, PyTorch tensors) to provide unit checks.
## Installation and Usage
You can install the python package from source (you need a rust compiler for that):
```
pip install git+https://github.com/itt-ustutt/quantity
```
or get the compiled files from PyPI
```
pip install si-units
```
## Examples
Calculate the pressure of an ideal gas.
```python
from si_units import *
temperature = 25.0 * CELSIUS
volume = 1.5 * METER**3
moles = 75.0 * MOL
pressure = moles * RGAS * temperature / volume
print(pressure) # 123.94785148011941 kPa
```
`numpy` functions can be used with SI units:
```python
from si_units import *
import numpy as np
ms = np.linspace(2.0, 4.0, 3) * METER
sqms = ms**2
print(sqms) # [4, 9, 16] m²
```
## Documentation
For the documentation, see [here](https://itt-ustutt.github.io/quantity/index.html).
Raw data
{
"_id": null,
"home_page": "https://github.com/itt-ustutt/quantity/tree/master/si-units",
"name": "si-units",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "physics, units, SI",
"author": "Philipp Rehner <prehner@ethz.ch>, Gernot Bauer <bauer@itt.uni-stuttgart.de>",
"author_email": "Philipp Rehner <prehner@ethz.ch>, Gernot Bauer <bauer@itt.uni-stuttgart.de>",
"download_url": null,
"platform": null,
"description": "# si-units\n\n[![documentation](https://img.shields.io/badge/docs-github--pages-blue)](https://itt-ustutt.github.io/quantity/index.html)\n[![PyPI version](https://badge.fury.io/py/si_units.svg)](https://badge.fury.io/py/si_units)\n\nRepresentation of quantities with SI units. \n\nThe package is written with flexibility in mind and is able to represent arbitrarily complex units.\nIn addition to simple scalar quantities, it can be used to decorate any complex data type (numpy arrays, PyTorch tensors) to provide unit checks.\n\n## Installation and Usage\n\nYou can install the python package from source (you need a rust compiler for that):\n\n```\npip install git+https://github.com/itt-ustutt/quantity\n```\n\nor get the compiled files from PyPI\n\n```\npip install si-units\n```\n\n## Examples\n\nCalculate the pressure of an ideal gas.\n\n```python\nfrom si_units import *\ntemperature = 25.0 * CELSIUS\nvolume = 1.5 * METER**3\nmoles = 75.0 * MOL\npressure = moles * RGAS * temperature / volume\nprint(pressure) # 123.94785148011941 kPa\n```\n\n`numpy` functions can be used with SI units:\n\n```python\nfrom si_units import *\nimport numpy as np\nms = np.linspace(2.0, 4.0, 3) * METER\nsqms = ms**2\nprint(sqms) # [4, 9, 16] m\u00b2\n```\n\n## Documentation\n\nFor the documentation, see [here](https://itt-ustutt.github.io/quantity/index.html).\n\n",
"bugtrack_url": null,
"license": "MIT OR Apache-2.0",
"summary": "Representation of SI unit valued scalars and arrays.",
"version": "0.10.0",
"project_urls": {
"Homepage": "https://github.com/itt-ustutt/quantity/tree/master/si-units",
"Source Code": "https://github.com/itt-ustutt/quantity"
},
"split_keywords": [
"physics",
" units",
" si"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "103d9aa987ed1507074e279e9ef5d88eee1456103d8a741b015fdb3412cad769",
"md5": "e75b826fbadece971865597b38da2261",
"sha256": "f89cf861797343a325c18052d4df86edff8332602cb6cd7d6db9e85378bd956a"
},
"downloads": -1,
"filename": "si_units-0.10.0-cp37-abi3-macosx_10_12_x86_64.whl",
"has_sig": false,
"md5_digest": "e75b826fbadece971865597b38da2261",
"packagetype": "bdist_wheel",
"python_version": "cp37",
"requires_python": null,
"size": 944234,
"upload_time": "2024-12-05T20:08:25",
"upload_time_iso_8601": "2024-12-05T20:08:25.150641Z",
"url": "https://files.pythonhosted.org/packages/10/3d/9aa987ed1507074e279e9ef5d88eee1456103d8a741b015fdb3412cad769/si_units-0.10.0-cp37-abi3-macosx_10_12_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ee2962763839b7c969cf189dee830ea04b5fcd2a35e521abeb8a20c6f7d6ff83",
"md5": "66dc55396b67210a118664cad7ebc29c",
"sha256": "5c7fd45b2b0cb39d80d12d6ae013379ef9bc43dc0d144e2500d40d2fd61640b2"
},
"downloads": -1,
"filename": "si_units-0.10.0-cp37-abi3-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "66dc55396b67210a118664cad7ebc29c",
"packagetype": "bdist_wheel",
"python_version": "cp37",
"requires_python": null,
"size": 885611,
"upload_time": "2024-12-05T20:08:27",
"upload_time_iso_8601": "2024-12-05T20:08:27.498458Z",
"url": "https://files.pythonhosted.org/packages/ee/29/62763839b7c969cf189dee830ea04b5fcd2a35e521abeb8a20c6f7d6ff83/si_units-0.10.0-cp37-abi3-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c9093c67d86552b94b0861c8df8328a79f4ae2c66433e3162ca2001d61efae89",
"md5": "055aa5c3301c724335bffc0c3b176f09",
"sha256": "fb81221af9d8767013198fd92a3e670598b169bf02464e55f0334ee9630356f5"
},
"downloads": -1,
"filename": "si_units-0.10.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "055aa5c3301c724335bffc0c3b176f09",
"packagetype": "bdist_wheel",
"python_version": "cp37",
"requires_python": null,
"size": 1062683,
"upload_time": "2024-12-05T20:08:29",
"upload_time_iso_8601": "2024-12-05T20:08:29.793542Z",
"url": "https://files.pythonhosted.org/packages/c9/09/3c67d86552b94b0861c8df8328a79f4ae2c66433e3162ca2001d61efae89/si_units-0.10.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "73a75d99865990aabc4b7a809843dd5f60b19d900989d7c77a1efa655ca28513",
"md5": "47749397b7d0dc5ff9b298278d7dd302",
"sha256": "2bb39f7b54c5111b52b201e1976fb3926ab720557316562dcad68dfb82b3a296"
},
"downloads": -1,
"filename": "si_units-0.10.0-cp37-abi3-win_amd64.whl",
"has_sig": false,
"md5_digest": "47749397b7d0dc5ff9b298278d7dd302",
"packagetype": "bdist_wheel",
"python_version": "cp37",
"requires_python": null,
"size": 776998,
"upload_time": "2024-12-05T20:08:31",
"upload_time_iso_8601": "2024-12-05T20:08:31.958718Z",
"url": "https://files.pythonhosted.org/packages/73/a7/5d99865990aabc4b7a809843dd5f60b19d900989d7c77a1efa655ca28513/si_units-0.10.0-cp37-abi3-win_amd64.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-05 20:08:25",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "itt-ustutt",
"github_project": "quantity",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "si-units"
}