Python API

Automate project setup, scan-case configuration, and element generation with a Python API that fits into repeatable engineering workflows.

Automate the workflow you already use

The Rezonance Python API gives you the same core workflow available through code: create or open projects, configure scanning, generate elements, and feed the results into automation or reporting pipelines.

The first release is focused, but covers the parts of the workflow that matter most for repeatability:

  • Access project information from code.
  • Build and reuse frequency sets.
  • Create and configure scan cases.
  • Refresh devices and modules.
  • Generate new elements programmatically.

Setting up a scan case

The API is especially useful when the task involves a family of runs: different controller settings, operating points, or PSCAD workspaces that should be processed the same way.

python

import rezonance as rz project = rz.Project(project_path="example.zpdb") scan_workspace = project.scan_workspace case = scan_workspace.create_scan_case( name="Weak-grid sweep", pscad_workspace_file=r"C:\studies\grid.pswx", active_sim_object="grid_model", ) case.set_workspace_frequency_set( frequency_set_name="1to100, log + 20to35, fine" ) new_elements = case.scan()

Working with frequency sets

Frequency sets are composed of reusable frequency blocks, each defining a span of frequencies with a distribution and resolution. This is useful when you want a broad logarithmic sweep combined with fine-resolution windows around known resonance bands.

python

sw = project.scan_workspace sw.create_frequency_block(configuration={ "name": "Broad sweep", "dist": "logarithmic", "low": 1.0, "high": 100.0, "count": 100, }) sw.create_frequency_block(configuration={ "name": "Dense 20-35", "dist": "linear", "low": 20.0, "high": 35.0, "count": 31, }) sw.create_frequency_set( name="custom sweep", frequency_block_names=["Broad sweep", "Dense 20-35"], merge_strategy="boundary_substitution", )

Inspecting project data

Once elements have been generated, you can query project data to inspect devices, elements, and their parameters without opening the GUI.

python

for name in project.get_device_names(): device = project.get_device(name) info = device.get_info() print(name, len(info["ports"]), "port(s)")

Fits into existing toolchains

Because the API operates on the same project concepts used in the application, results stay aligned with how engineers work in the GUI. Scripts can generate or inspect the same project objects that colleagues later review visually.

API strengthBenefit
Project-centric modelAutomation follows the same mental model as the desktop workflow.
Scriptable frequency and scan-case setupRepeated studies become easier to reproduce and audit.
Element generation in codeConnect scanning to custom orchestration, QA checks, or reporting pipelines.
Plotting supportGenerated outputs can still be inspected quickly when a script produces a result to review.

Built to grow

This first release focuses on create and view workflows rather than full editing or delete operations, and analysis support is in development. Even so, it opens the door to useful automation for organisations that want to standardise scanning or integrate Rezonance into wider engineering toolchains.

Keep exploring Python API

Dive further into the Rezonance workflow, compare capabilities, and see how this feature fits into the broader analysis platform.

Explore all features