A simple framework to work with physical magnitudes
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file properunits-0.0.3.tar.gz
.
File metadata
- Download URL: properunits-0.0.3.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6da95404e4335e62f2620cb7043c7d83b0c2e7bd76efbebf674a57f93b0fd71a |
|
MD5 | 34d5addcae427d37bad5b84e535281b5 |
|
BLAKE2b-256 | 238c2b7a0364e1c44a00256e39aa1d26c05e2041ddd42eea037df0cec3c1252d |
File details
Details for the file properunits-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: properunits-0.0.3-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b96968129df60da49d0820bb7e69d4ac64d7edc0ee2f6fbc3c29c46d99c572e |
|
MD5 | 79c6df4f2088eec14b93f68feb46232c |
|
BLAKE2b-256 | f90743e2dfb49b900a06eef8f6f95cfe464875edbeca1f4d8b295eeda1af696a |