Direct port of pyenergyplus that comes with EnergyPlus into a standalone Python package
Project description
pyenergyplus (LBNL)
pyenergyplus is a pip-installable wheel that packages the EnergyPlus
simulation engine and its Python API. It also ships pyenergyplus.model,
a Pydantic v2 sub-package providing data models for the EnergyPlus epJSON
format. Both components are versioned together and always track the same
EnergyPlus release.
Installation
pip install pyenergyplus-lbnl
Usage
Simulation API
from pyenergyplus.api import EnergyPlusAPI
api = EnergyPlusAPI()
state = api.state_manager.new_state()
api.runtime.run_energyplus(state, ["-w", "weather.epw", "-r", "model.idf"])
epJSON data models (pyenergyplus.model)
Load an epJSON file into a typed EnergyPlusModel:
import json
from pyenergyplus.model import EnergyPlusModel
with open("model.epJSON") as f:
model = EnergyPlusModel.model_validate(json.load(f))
print(model.version)
Modify fields through the Pydantic model, then serialize back to a dict and
write to a file for simulation. Use by_alias=True so object-type keys match
the EnergyPlus epJSON format (e.g. "Building" not "building"), and
exclude_none=True to omit optional fields that were not set:
import json, tempfile, os
from pyenergyplus.api import EnergyPlusAPI
from pyenergyplus.model import EnergyPlusModel
with open("model.epJSON") as f:
model = EnergyPlusModel.model_validate(json.load(f))
# --- make changes to the model here ---
epjson_dict = model.model_dump(by_alias=True, exclude_none=True)
with tempfile.NamedTemporaryFile(
mode="w", suffix=".epJSON", delete=False
) as tmp:
json.dump(epjson_dict, tmp)
tmp_path = tmp.name
api = EnergyPlusAPI()
state = api.state_manager.new_state()
api.runtime.run_energyplus(state, ["-w", "weather.epw", "-r", tmp_path])
os.unlink(tmp_path)
Individual model classes are importable from pyenergyplus.model.model:
from pyenergyplus.model.model import WindowMaterialGas, GasType
gas = WindowMaterialGas(gas_type=GasType.air, thickness=0.012)
Builder helpers
from pyenergyplus.model.builder import (
ConstructionComplexFenestrationStateBuilder,
ConstructionComplexFenestrationStateInput,
)
Bundled reference models and weather files
from pyenergyplus.dataset import ref_models, ashrae_models, weather_files
idf_path = ref_models["large_office"]
epw_path = weather_files["chicago"]
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 Distributions
Built Distributions
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 pyenergyplus_lbnl-26.1.0-py3-none-win_amd64.whl.
File metadata
- Download URL: pyenergyplus_lbnl-26.1.0-py3-none-win_amd64.whl
- Upload date:
- Size: 21.9 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5669748080888d33424a6c2bae665fedc5b14fa7d43dc897cf20d46ee2ee3426
|
|
| MD5 |
f40c2311849d9d223af87eaddfe971fb
|
|
| BLAKE2b-256 |
399a2ef6f39fa7865bb5da4cd84702cb169a2974bb3045e2575d0613b66890ba
|
Provenance
The following attestation bundles were made for pyenergyplus_lbnl-26.1.0-py3-none-win_amd64.whl:
Publisher:
publish.yml on taoning/pyenergyplus
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyenergyplus_lbnl-26.1.0-py3-none-win_amd64.whl -
Subject digest:
5669748080888d33424a6c2bae665fedc5b14fa7d43dc897cf20d46ee2ee3426 - Sigstore transparency entry: 1288028489
- Sigstore integration time:
-
Permalink:
taoning/pyenergyplus@5e91ce49e637670dfa479e5809288d3abf3fa59b -
Branch / Tag:
refs/tags/v26.1.0 - Owner: https://github.com/taoning
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5e91ce49e637670dfa479e5809288d3abf3fa59b -
Trigger Event:
release
-
Statement type:
File details
Details for the file pyenergyplus_lbnl-26.1.0-py3-none-manylinux1_x86_64.whl.
File metadata
- Download URL: pyenergyplus_lbnl-26.1.0-py3-none-manylinux1_x86_64.whl
- Upload date:
- Size: 46.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
16bda1d451a72d8ec27697d8c52f804a7ce1c51b0ccb567b80033652e356720b
|
|
| MD5 |
96989e25a78a00bba3db2602d55c88f9
|
|
| BLAKE2b-256 |
1bfa03767459c9f4281ed2a0778eea1d5f033f27669de43a6c22ccb9326198e4
|
Provenance
The following attestation bundles were made for pyenergyplus_lbnl-26.1.0-py3-none-manylinux1_x86_64.whl:
Publisher:
publish.yml on taoning/pyenergyplus
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyenergyplus_lbnl-26.1.0-py3-none-manylinux1_x86_64.whl -
Subject digest:
16bda1d451a72d8ec27697d8c52f804a7ce1c51b0ccb567b80033652e356720b - Sigstore transparency entry: 1288028378
- Sigstore integration time:
-
Permalink:
taoning/pyenergyplus@5e91ce49e637670dfa479e5809288d3abf3fa59b -
Branch / Tag:
refs/tags/v26.1.0 - Owner: https://github.com/taoning
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5e91ce49e637670dfa479e5809288d3abf3fa59b -
Trigger Event:
release
-
Statement type:
File details
Details for the file pyenergyplus_lbnl-26.1.0-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: pyenergyplus_lbnl-26.1.0-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 37.0 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
629fb061b78f529b682477fb0396cf4f3e3c67e31fbff4e20d574b8352afc2a9
|
|
| MD5 |
3c5a054ebaadb6a2d45e4eaac1552025
|
|
| BLAKE2b-256 |
20b45227a206df7d7fb4bd94934aeb7ed8a27b618489cda00fc74305bdf7e7b6
|
Provenance
The following attestation bundles were made for pyenergyplus_lbnl-26.1.0-py3-none-macosx_11_0_arm64.whl:
Publisher:
publish.yml on taoning/pyenergyplus
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyenergyplus_lbnl-26.1.0-py3-none-macosx_11_0_arm64.whl -
Subject digest:
629fb061b78f529b682477fb0396cf4f3e3c67e31fbff4e20d574b8352afc2a9 - Sigstore transparency entry: 1288028258
- Sigstore integration time:
-
Permalink:
taoning/pyenergyplus@5e91ce49e637670dfa479e5809288d3abf3fa59b -
Branch / Tag:
refs/tags/v26.1.0 - Owner: https://github.com/taoning
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5e91ce49e637670dfa479e5809288d3abf3fa59b -
Trigger Event:
release
-
Statement type: