Python DSL reference
Python objects -> Service Architect YAML -> generated projectPython DSL overview
A typed authoring layer for the same topology consumed by the designer and ServiceGen.
When to use
Use Python when composition, reuse, enums, object references, and code-level validation are more convenient than editing YAML directly.
Behavior
- Python is an authoring representation; YAML remains the stable Service Architect interchange contract.
- Services, streams, connectors, endpoints, types, pools, modules, packages, and functions are represented by objects instead of repeated string references.
- Factories expose only properties supported by that concrete entity type.
- The same Project can emit YAML, create a designer-compatible JSON payload, or request a generated ZIP project.
Authoring workflow
AuthorTyped Python projectCompose services, pipelines, endpoints, types, and links.
Validateproject.validate()Report ServiceGen-compatible diagnostics.
Interchangeproject.to_yaml()Produce the stable symbolic topology.
Generateproject.generate_code()Authenticate and receive the generated ZIP.
Resources properties
Package and source locations.
PropertyTypeDescription
RepositoryGitHubhttps://github.com/gorundebug/sa-python-dsl
Python>= 3.11Minimum supported interpreter version.
Runtime dependencyPyYAML >= 6, < 7YAML parsing and serialization.
Python example
from sa_dsl import Project
project = Project(
"Orders",
module_version="v1.0.0",
repo_path="github.com/example/orders",
)