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.5.2.tar.gz (24.3 kB view details)

Uploaded Source

Built Distribution

PH_units-1.5.2-py2.py3-none-any.whl (29.1 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: PH-units-1.5.2.tar.gz
  • Upload date:
  • Size: 24.3 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.5.2.tar.gz
Algorithm Hash digest
SHA256 021add41d5c816419756899269834cd2ddda39740c7aecb9a3eef59ec764252c
MD5 0d4d3b164a6828f9da85700ab19799fc
BLAKE2b-256 7510e2ac60e10192afa88ac7e6b2e8346446cae15176031820ee32f75497c65f

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: PH_units-1.5.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 29.1 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.5.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 32a4c96e95b378240fc0f82f2415229e5ff9ab92ead464d737f35bc0aeaa825d
MD5 77679859bc4c034556bb3a39f5b2c40b
BLAKE2b-256 588f53d841b54b14c1069ceafda6979028f5a98cee6049c773f6f3029a7518a2

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