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
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
PH-units-1.0.3.tar.gz
(20.3 kB
view hashes)
Built Distribution
Close
Hashes for PH_units-1.0.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1960f12d9875e05890e4cc345b7e3eaaa0b7b582307d4d853a0f7f486955d26 |
|
MD5 | 2d4816b17220fbea5c2e0905169cb209 |
|
BLAKE2b-256 | 6e57172f0951f9f2763b75b9d9770d2be33c17a7cf01d1d3b576baeaaeada7a5 |