Tools for working with common Passive House unit types
Project description
PH-Units:
A package for converting common Passive House unit types (IP | SI).
Usage:
The most basic usage is a simple conversion from one known unit to another:
>>> from ph_units.converter import convert
>>> # Convert 12.45 meters to feet...
>>> convert(12.45, "M", "FT") -> 40.85 # FT
The package also has a parser which can take simple text in the format: "{value} {unit}"
and will split apart the text into a numeric part and a unit part:
>>> from ph_units.parser import parse_input
>>> val, unit = parse_input("0.17 BTU/HR-FT2-F")
>>> val # 0.17
>>> unit # 'BTU/HR-FT2-F'
The results of the parser can then be fed into the converter
>>> from ph_units.converter import convert
>>> convert(val, "W/MK", unit) -> 0.098 # BTU/HR-FT2-F
Unit Types Supported:
- Length (m, cm, mm, in, ft)
- Area (m2, ft2)
- volume (m2, ft3, liters, gallons)
- energy (Wh/M3, Wh/M2, kW/M2, kBtu/ft2, Btu/ft2)
- power (kW, W, W/M2, W/ft2, W/cfm, Btu/h-ft2, Btu/h)
- speed (m/d, m/s, m/h, ft/s, ft/d)
- temperature (C, F)
- volume flow (m3/hr, cfm)
Adding New Units:
The conversion factors used are stored as types in the ph_units.unit_types
directory. Note that the types also allow for common 'alias' descriptions ie: 'feet' can be denoted as "FT", "ft." or even the symbol '
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 PH-units-1.5.0.tar.gz
.
File metadata
- Download URL: PH-units-1.5.0.tar.gz
- Upload date:
- Size: 24.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 194b87242d6a6a135693945760c46d6b9eb40252498333728198e048ecdb70ff |
|
MD5 | 993739a7f692f3ccb8bbea32f2f666b3 |
|
BLAKE2b-256 | f5f41cee0720909287359d8b2a7a9efd5266a7e11d40fc2af64a07f874e4f74a |
Provenance
File details
Details for the file PH_units-1.5.0-py2.py3-none-any.whl
.
File metadata
- Download URL: PH_units-1.5.0-py2.py3-none-any.whl
- Upload date:
- Size: 28.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06e42abf9bf2233c2db2ef8475496b53258f5efaaf08b8198881dea5a112b0a8 |
|
MD5 | eeb2883552c3e11b9d56dea9617c4174 |
|
BLAKE2b-256 | de6b4440ff83c426e352037907b5832e408342eb3355479379bab13827d7539b |