Properunits
A simple framework to work with physical magnitudes
Motivation
Properunits does one simple job: it helps you define physical magnitudes in Python using units and automatically convert them to SI units so that downstream calculations are all done consistently.
Properunits does not attempt to do universal unit conversion or tries to implement operations that preserve and transform the units. It is meant to extract numerical values that can be used anywhere without having to worry about unit conversion, while keeping information on the original value and units used.
Status
Properunits is still in development. Please check the documentation in readthedocs.
Quick install
Through pypi:
pip install properunits
Usage
from properunits import Temperature, Pressure
T = Temperature(100, 'C')
p = Pressure(1, 'bar')
print(T.x, T.units) # Return value in SI units.
print(Temperature.list_units()) # Return list of temperature units
print(T.value) # Return the original value, unit
Copyright and license
Properunits is distributed under the terms of MIT License.
Metadata
Release files for properunits 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| properunits-0.1.0.tar.gz | 8.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| properunits-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.3 kB
Release files / properunits-0.1.0.tar.gz
| Download URL | properunits-0.1.0.tar.gz |
|---|---|
| Size | 8.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3a34440903f1ded714a04918f3decf853e8212bd1e763a5566f891ce593b68bf
|
|
BLAKE2b-256 checksum How to use checksums |
df6e128dc9106c138c74f8f268559ce1d632b54f2d9eac8d816650a9a20f9c29
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.9
|
Release files / properunits-0.1.0-py3-none-any.whl
| Download URL | properunits-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0709de434775ef300508860ee8ef2018b8b456bcb3e942366f85cc465d8e22e6
|
|
BLAKE2b-256 checksum How to use checksums |
adaaea92479bbd60129118cc66a6b184fec2f87a83cf060314ea094532a2e96a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.9
|