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'
>>>
>>> from ph_units.converter import convert
>>> convert(val, "W/MK", unit) -> 0.098 # BTU/HR-FT2-F
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 '
Types:
- Length (m, cm, mm, in, ft)
- Area (m2, ft2)
- volume (m2, ft3, liters, gallons)
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
PH-units-1.0.1.tar.gz
(20.0 kB
view hashes)
Built Distribution
Close
Hashes for PH_units-1.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 125a5447ea8b3c69faddda0cf29af789e9a7e4225b1eb74f391c53f7b3e311d6 |
|
MD5 | 6bd7b1c739da38e8cb8acf818a10f6d5 |
|
BLAKE2b-256 | a7df2d1217f24b0dcd095dc21146ea9fa0b164597fa71bbce44a87dd3bfb365f |