Python library for using and testing SimStadt workflows.
Project description
simstadt
A Python library for running and testing SimStadt workflows programmatically.
SimStadt is a city simulation tool for energy and urban analysis developed at HFT Stuttgart. This library wraps its CLI to execute workflows against CityGML files and parse the results into pandas DataFrames.
Requirements
- Python 3.10+
- SimStadt installed separately
Installation
pip install simstadt
Usage
from simstadt import heatdemand_simulation, photovoltaic_simulation, greenwater_simulation, clean_old_workflows
results = heatdemand_simulation("path/to/city.gml", "Wuerzburg-hour.csv")
print(results.dataframe)
print(results.kpis)
pv = photovoltaic_simulation("path/to/city.gml", "Wuerzburg-hour.csv")
print(pv.dataframe)
gw = greenwater_simulation("path/to/city.gml", "Wuerzburg-hour.csv", irrigation_ratio=0.5)
print(gw.dataframe)
# Remove workflow folders older than 1 hour from a project directory
clean_old_workflows(Path("path/to/project.proj"))
For more control, use run_workflow_with_citygml directly:
from simstadt import run_workflow_with_citygml
results = run_workflow_with_citygml(
template="104_HeatDemandWithShadow", # name in templates/ or full Path
citygml_path="path/to/city.gml",
replaces={"<string>METEONORM_FILE</string>": "<string>Wuerzburg-hour.csv</string>"},
project_path=Path("path/to/project.proj"), # optional
)
print(results.kpis)
SimStadt is located automatically via the SIMSTADT_FOLDER environment variable, or by searching ~/Desktop for a SimStadt2_0.*/ directory.
Bundled workflow templates are used by default. Custom templates are resolved via SIMSTADT_TEMPLATE_PATH, or a templates/ directory in the current working directory.
If no project path is specified, workflows are run in a temporary repository under /tmp/simstadt_repo/.
CLI
# Print detected SimStadt installation path and version
simstadt
# Launch the SimStadt GUI
simstadt --gui
# Run a workflow from the command line
simstadt 104_HeatDemandWithShadow path/to/city.gml -v
# Save results to CSV or JSON
simstadt 104_HeatDemandWithShadow path/to/city.gml --save results.csv
# Run RegionChooser (separate entry point)
regionchooser
Development
uv sync
uv run pytest # all tests
uv run pytest -m "not integration" # skip tests requiring SimStadt
Links
- Code is hosted at https://transfer.hft-stuttgart.de/gitlab/simstadt/simstadtpy
- Python package is hosted at https://pypi.org/project/simstadt/
AI agent
SimStadtResults and tests have been written manually during research projects.
Claude Code has been used to refactor and package the scripts into this library.
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
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 simstadt-0.1.9.tar.gz.
File metadata
- Download URL: simstadt-0.1.9.tar.gz
- Upload date:
- Size: 24.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.2","id":"zara","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
679d628a3e54686747f8e29471855e5113306773d985052cfe2ecfe087032b19
|
|
| MD5 |
68f10470577521c25ea8988a68eb073c
|
|
| BLAKE2b-256 |
23cb77bbb3575f6ffd8d2475e386d7338faa177e134df6ae7889084deabbf8a6
|
File details
Details for the file simstadt-0.1.9-py3-none-any.whl.
File metadata
- Download URL: simstadt-0.1.9-py3-none-any.whl
- Upload date:
- Size: 76.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.2","id":"zara","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
353d51e96513b91dd0197dcfd833e048eb16e6bf401367f2ff983bdb093792ce
|
|
| MD5 |
1734f3f5b301f2e8a45634cdb0a542aa
|
|
| BLAKE2b-256 |
6b168913e0eba7aac8cc6c2b4016b1a3106b12fa22bd7247a79f14c79774a9fc
|