Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

properunits-0.1.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

properunits-0.1.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file properunits-0.1.0.tar.gz.

File metadata

  • Download URL: properunits-0.1.0.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for properunits-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3a34440903f1ded714a04918f3decf853e8212bd1e763a5566f891ce593b68bf
MD5 8fa2a3fcea9cd233da8a417ff82fcc56
BLAKE2b-256 df6e128dc9106c138c74f8f268559ce1d632b54f2d9eac8d816650a9a20f9c29

See more details on using hashes here.

File details

Details for the file properunits-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: properunits-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for properunits-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0709de434775ef300508860ee8ef2018b8b456bcb3e942366f85cc465d8e22e6
MD5 af43d3d77e1343e5fc1d36f4851ee645
BLAKE2b-256 adaaea92479bbd60129118cc66a6b184fec2f87a83cf060314ea094532a2e96a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page