Skip to main content

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+
  • Java 17+
  • SimStadt installed separately (or use simstadt --install)

Installation

pip install simstadt

Usage

from simstadt import heatdemand_simulation, photovoltaic_simulation, greenwater_simulation, clean_old_workflows

results = heatdemand_simulation("path/to/city.gml")
print(results.dataframe)
print(results.kpis)

pv = photovoltaic_simulation("path/to/city.gml")
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="HeatDemandWithShadow",   # name in templates/ or full Path
    citygml_path="path/to/city.gml",
    replaces={"<string>METEONORM_FILE</string>": "<string>Wuerzburg-hour.csv</string>"}, # optional
    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

# See help
simstadt --help
    usage: simstadt [-h] [--gui] [--csv-export] [--install] [-d DESCRIPTION] [--destination DESTINATION] [-p PROJECT_PATH] [-f] [-s PATH] [-v] [-V] [template] [citygml]

    simstadt - Python library for SimStadt workflows.

    positional arguments:
      template              Template name (from SIMSTADT_TEMPLATE_PATH), path to a .flow directory, or a bundled template name.
      citygml               Path to the CityGML input file.

    options:
      -h, --help            show this help message and exit
      --gui                 Launch the SimStadt GUI.
      --csv-export          Export CSV from workflowsteps, when available.
      --install             Download and install the latest SimStadt release to ~/Desktop.
      -d DESCRIPTION, --description DESCRIPTION
                            Human-readable label for the result.
      --destination DESTINATION
                            Workflow folder name (default: timestamped random id).
      -p PROJECT_PATH, --project-path PROJECT_PATH
                            Directory where the workflow folder is created.
      -f, --files           Show output files after the run.
      -s PATH, --save PATH  Save result DataFrame to a file (.csv or .json).
      -v, --verbose         Enable debug logging.
      -V, --version         Print the simstadtpy and SimStadt versions, then exit.

# Print the simstadtpy and SimStadt versions
simstadt --version

# Download and install the latest SimStadt release to ~/Desktop
simstadt --install

# Launch the SimStadt GUI
simstadt --gui

# Run a workflow from the command line
simstadt HeatDemandWithShadow.flow path/to/city.gml -v

# Save results to CSV or JSON
simstadt PVWithShadow path/to/city.gml --save results.csv

# Save results to CSV or JSON
simstadt HeatDemand path/to/city.gml --save results.csv

# List output files
simstadt HeatDemand.flow path/to/city.gml --files

# Debug information
simstadt PV path/to/city.gml --verbose

# Run RegionChooser (separate entry point)
regionchooser

Development

uv sync
uv run pytest               # all tests
uv run pytest -m "not integration"  # skip tests requiring 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.

Release files for simstadt 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simstadt 0.3.0
File Size Uploaded
simstadt-0.3.0.tar.gz 26.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for simstadt 0.3.0
File Interpreter ABI Platform
simstadt-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 105.5 kB

Release files / simstadt-0.3.0.tar.gz

Download URL simstadt-0.3.0.tar.gz
Size 26.4 kB
Tags Source
SHA-256 checksum
How to use checksums
bf928c6ff0759d621503f98963c7cb0c8e4ccc76931e28a37d15990a8a389799
BLAKE2b-256 checksum
How to use checksums
4e6a4718086ed0d15352f7ef06936968636d81bed3edb8f07760d32a83fbcbc9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","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}

Release files / simstadt-0.3.0-py3-none-any.whl

Download URL simstadt-0.3.0-py3-none-any.whl
Size 79.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
879c6dbc6bfaaede01280aa848b1edd427812076ef2a61ca2f3f545afde1cb40
BLAKE2b-256 checksum
How to use checksums
a2a00dd66f0810a4a6ab1fbacce1ec19dd92ec519114e4122c1a53e358492df4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","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}

Release history Release notifications | RSS feed

0.3.1

2 release files

This release

0.3.0 This release

2 release files

0.2.11

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page