Documentation: https://maxcode123.github.io/property-utils/
Source code: https://github.com/Maxcode123/property-utils
PyPI: https://pypi.org/project/property-utils/
property-utils
Utilities for programming that involves physical properties
What is property-utils?
property-utils is a python library that aims at making programming with physical properties easier. It was created to be used by scientists and engineers with little programming experience.
What is provided by property-utils?
Unit arithmetics
You can divide and multiply units to create new units. For example you can create velocity units by dividing length units with time units.
Unit conversions
You can easily convert a property from one unit to another by calling a method.
Property arithmetics
You can add, subtract, divide and multiply properties to create new properties. For example, you can create a density property by dividing a mass property with a volume property.
Installation
pip install property-utils
Quick usage
A simple example:
import math
from property_utils.properties import p
from property_utils.units import (
BTU,
FOOT,
RANKINE,
HOUR,
CENTI_METER,
METER,
KELVIN,
KILO_WATT,
)
tube_radius = p(12, CENTI_METER)
tube_length = p(2.3, METER)
heat_exchange_area = 2 * math.pi * tube_length * tube_radius
heat_transfer_coeff = p(150, BTU / RANKINE / FOOT**2 / HOUR)
cold_in = p(273, KELVIN)
cold_out = p(300, KELVIN)
hot_in = p(520, KELVIN)
hot_out = p(472, KELVIN)
diff_in = hot_in - cold_in
diff_out = hot_out - cold_out
temperature_diff = (diff_in - diff_out) / math.log((diff_in / diff_out).value)
print("Heat transfer coefficient =", heat_transfer_coeff)
print("Heat exchange area =", heat_exchange_area)
print("Temperature difference =", temperature_diff)
heat_duty = heat_transfer_coeff * heat_exchange_area * temperature_diff
print("\nHeat duty =", heat_duty)
print(" =", heat_duty.to_si())
print(" =", heat_duty.to_unit(KILO_WATT))
Result:
Heat transfer coefficient = 150 Btu / (ft^2) / hr / °R
Heat exchange area = 1.7341591447815656 (m^2)
Logarithmic mean temperature difference = 207.24308513672648 K
Heat duty = 1044588.4611345044 Btu / hr
= 306122.45180469507 J / s
= 306.12245180469506 kW
Metadata
Release files for property-utils 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| property_utils-0.3.1.tar.gz | 27.2 kB | Without provenance | Details for property_utils-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| property_utils-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for property_utils-0.3.1-py3-none-any.whl |
Total release size: 58.3 kB
Release files / property_utils-0.3.1.tar.gz
| Download URL | property_utils-0.3.1.tar.gz |
|---|---|
| Size | 27.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8bbeb8a55bcf9dac948361c54bf35bad153890ce38a6d6864c5f7908fd40d9bc
|
|
BLAKE2b-256 checksum How to use checksums |
eae6575a8f4397ae3830eb946b4b6d4db8dbca379a4858a811a00c8fff2fe5b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.5
|
Release files / property_utils-0.3.1-py3-none-any.whl
| Download URL | property_utils-0.3.1-py3-none-any.whl |
|---|---|
| Size | 31.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
779c5ed38bd23662fd81013b23ee3cab0caff989f539e5ea8e92fd737e581db0
|
|
BLAKE2b-256 checksum How to use checksums |
a99eaf6a00364767692f8c769785460b0b75e5d41fe7c9eb7730eb57625aaf14
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.5
|
Security for property-utils 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.