Python DSL reference
yaml_to_python_project(source, output_dir)Generate Python from YAML
Reverse an existing Service Architect YAML document into a modular, importable Python project.
When to use
Use this when adopting the Python DSL for an existing graph or rebuilding generated Python sources from canonical YAML.
Behavior
- Every entity is emitted into its corresponding modules, pools, types, connectors, endpoints, services, or pipelines directory.
- Pipeline-local connections are emitted in pipeline files; cross-pipeline connections are emitted in service files.
- Non-default persisted link calls are emitted directly beside their graph connections.
- The generated package exposes
project, and calling itsto_yaml()recreates an equivalent topology.
Function parameters properties
Inputs and result.
PropertyTypeDescription
sourcestr | Path | MappingYAML path or parsed topology document.
output_dirstr | PathNew Python package directory.
return valuePathGenerated main.py entry point.
Python example
from sa_dsl import yaml_to_python_project
entrypoint = yaml_to_python_project(
"architecture.yaml",
"generated_processorder",
)