Skip to main content

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 '


Tests versions IronPython

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

PH-units-1.4.0.tar.gz (23.9 kB view details)

Uploaded Source

Built Distribution

PH_units-1.4.0-py2.py3-none-any.whl (28.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file PH-units-1.4.0.tar.gz.

File metadata

  • Download URL: PH-units-1.4.0.tar.gz
  • Upload date:
  • Size: 23.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.17

File hashes

Hashes for PH-units-1.4.0.tar.gz
Algorithm Hash digest
SHA256 f7dbe601296b7752ff4e5479940e6b7a3e794102ab5add3f9f26d10aab0ee0b8
MD5 602bd4cf1a3ea6fc97fc0b15b2b1094f
BLAKE2b-256 0377b6814117fe42ea7e0cfb6de1af67471c6b249370f65648572938a18e0d7b

See more details on using hashes here.

Provenance

File details

Details for the file PH_units-1.4.0-py2.py3-none-any.whl.

File metadata

  • Download URL: PH_units-1.4.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 28.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.17

File hashes

Hashes for PH_units-1.4.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ba94e0550f778fbed4699b6769fff76e32e2ba5259d7c6138f09de62b35f6e84
MD5 8bdb608bf8c958725411e4eaecf928a6
BLAKE2b-256 3bf287c5909e2a7ecb52e9f13a1b3b475811a5ed505869b01686cf30af748622

See more details on using hashes here.

Provenance

Supported by

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