OpenPH
Core PHPP data models and table view generation
Part of the openph UV workspace - a Python implementation of Passive House Planning Package (PHPP) calculations with exact numerical fidelity to Excel PHPP.
Purpose
OpenPH provides:
- Data Models: Python classes representing PHPP building components (areas, constructions, rooms, climate, HVAC systems)
- Table Rendering: Generate formatted output tables (.txt, .html) matching PHPP worksheet layouts for validation
- Plugin Architecture: Extensible table system with auto-discovery via entry points
- HBJSON Import: Convert Honeybee-PH JSON models to OpenPH data structures
Structure
openph/
├── src/
│ └── openph/ # Main package module
│ ├── model/ # PHPP data classes
│ ├── to_table/ # Table rendering system (plugin-based)
│ ├── from_HBJSON/# Honeybee-PH JSON import
│ └── phpp.py # Main PHPP container class
├── tests/
└── pyproject.toml
Usage
Converting a PHX Model (canonical entry point)
OpenPH's public conversion boundary accepts a live, in-memory
PHX.model.project.PhxVariant — no file I/O, no serialization round trips.
OpenPH does not accept native Honeybee objects; Honeybee → PHX is PHX's
concern, PHX → OpenPH is OpenPH's:
Honeybee/honeybee-ph model
→ PHX.conversion.from_honeybee
→ PhxProject
→ select exactly one PhxVariant
→ openph.conversion.from_phx_variant
→ OpPhPHPP
from PHX.conversion import from_honeybee
from openph.conversion import from_phx_variant
phx_project = from_honeybee(hb_model, group_components=True)
if len(phx_project.variants) != 1:
raise ValueError(f"OpenPH requires exactly one PHX variant; got {len(phx_project.variants)}")
phpp = from_phx_variant(phx_project.variants[0])
# Calculate through a registered solver (requires the openph-demand plugin):
heating = phpp.get_solver("energy_demand").heating_demand
annual_kwh = heating.total_yearly_heating_demand # Heating!AF117
annual_kwh_m2a = heating.total_yearly_specific_heating_demand # Heating!Q78
Read the annual scalars rather than summing a monthly row: each is a canonical PHPP-addressed result, so every consumer reports the same number.
Getting results out
Three surfaces, each doing one job — pick by what the caller needs:
| Need | Use |
|---|---|
| Audit / PHPP comparison — every input, intermediate, and final value with its worksheet address | openph.results.collect_results(phpp) → OpPhResults |
| An application payload — annual and monthly demand, warnings, provenance, small enough to return per request | openph_demand.build_energy_demand_summary(phpp) → EnergyDemandSummary |
| Human inspection / export | the table views (openph[tables]) |
The compact summary supplements the audit document rather than replacing it;
for one model it is roughly 200x smaller. Core openph needs neither pandas
nor rich for the first two.
from_phx_variant preflights the variant and validates the finished model
with the structured readiness diagnostics (openph.validate): it raises
OpPhValidationError carrying a machine-readable OpPhValidationReport when
error-severity issues exist, and returns a fully built, validated,
solver-ready OpPhPHPP otherwise. Call openph.validate_phx_variant(variant)
directly for report-style (non-raising) feedback.
The legacy import path openph.from_HBJSON.create_phpp.from_phx_variant
remains functional and is the same single implementation.
Basic Model Creation
from openph.phpp import OpPhPHPP
# Create PHPP model
phpp = OpPhPHPP()
# Access model components
phpp.climate
phpp.areas
phpp.rooms
phpp.hvac
Table Rendering (Single Tables)
from openph.to_table import TableDisplayManager, TableNames
# Initialize table display manager
display = TableDisplayManager(phpp)
# Render individual tables
climate_table = display.get_table(TableNames.CLIMATE_ANNUAL)
climate_table.render(format="console")
climate_table.render(format="html", output_path="climate.html")
Table Grouping (Recommended)
Group related tables and render to a single file:
from openph.to_table import TableDisplayManager, TableNames
display = TableDisplayManager(phpp)
# Create logical groups
climate_group = display.create_group([
TableNames.CLIMATE_ANNUAL,
TableNames.CLIMATE_PEAK_LOAD,
TableNames.CLIMATE_RADIATION_FACTORS,
])
# Render entire group to one file
climate_group.render(format="html", output_path="./climate_report.html")
climate_group.render(format="txt", output_path="./climate_report.txt")
Available Core Tables
Climate: CLIMATE_ANNUAL, CLIMATE_PEAK_LOAD, CLIMATE_RADIATION_FACTORS
Areas: AREAS_SUMMARY, AREAS_OPAQUE_SURFACE_*, AREAS_APERTURE_*, AREAS_SOLAR_REDUCTION_*
Rooms: ROOMS_VENTILATION_PROPERTIES, ROOMS_VENTILATION_SCHEDULE
Ventilation: VENTILATION_DUCT_INPUTS, VENTILATION_DUCT_RESULTS, VENTILATION_DUCT_*
See TableNames class for complete list.
Development
Part of UV workspace - see root context/ENVIRONMENT.md:
uv sync # Install all workspace packages
uv run pytest openph/tests/ # Run tests
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openph-0.7.0.tar.gz.
File metadata
- Download URL: openph-0.7.0.tar.gz
- Upload date:
- Size: 161.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bef96022ba603ce23542cd43d35a8b9c1cff2f8806ba772ac7601898f5ec729d
|
|
| MD5 |
58e2c6c3d3add916e5cd6c2c82a4452e
|
|
| BLAKE2b-256 |
3352b786bb79cb02c03d00a94e2ca94a861b1c3803664439a21fc2dfedd71af8
|
Provenance
The following attestation bundles were made for openph-0.7.0.tar.gz:
Publisher:
publish.yml on Open-PH/openph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openph-0.7.0.tar.gz -
Subject digest:
bef96022ba603ce23542cd43d35a8b9c1cff2f8806ba772ac7601898f5ec729d - Sigstore transparency entry: 2470452027
- Sigstore integration time:
-
Permalink:
Open-PH/openph@7dfe23a53694c3d18b1360e6dc2ef50ecabda58b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Open-PH
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7dfe23a53694c3d18b1360e6dc2ef50ecabda58b -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file openph-0.7.0-py3-none-any.whl.
File metadata
- Download URL: openph-0.7.0-py3-none-any.whl
- Upload date:
- Size: 187.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a1cf5bf459a32a8b8c38751111474bb2279c38461980ff77c69984da4613bc4
|
|
| MD5 |
829dc805b5c71790b73f082d8e6e29ca
|
|
| BLAKE2b-256 |
afe349c23ccf1e712ac42833ec4620eabd7bf0b5c9f02ed249bbffee0b4426b4
|
Provenance
The following attestation bundles were made for openph-0.7.0-py3-none-any.whl:
Publisher:
publish.yml on Open-PH/openph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openph-0.7.0-py3-none-any.whl -
Subject digest:
2a1cf5bf459a32a8b8c38751111474bb2279c38461980ff77c69984da4613bc4 - Sigstore transparency entry: 2470452049
- Sigstore integration time:
-
Permalink:
Open-PH/openph@7dfe23a53694c3d18b1360e6dc2ef50ecabda58b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Open-PH
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7dfe23a53694c3d18b1360e6dc2ef50ecabda58b -
Trigger Event:
workflow_dispatch
-
Statement type: