SAService Architect Back to designer
SAService ArchitectDocumentation
Python API reference yaml_to_python_project() | yaml_to_api_document()

YAML conversion API

Convert canonical YAML either into Python source modules or into the flat designer/API JSON model.

When to use

Use these functions at integration boundaries rather than manually rewriting topology collections and references.

Behavior

  • yaml_to_python_project emits a complete importable package and returns its main.py path.
  • yaml_to_api_document ports the designer fromYaml(...).toJSON() conversion.
  • Both functions accept a path or parsed Mapping; API conversion also accepts YAML text.

yaml_to_python_project() properties

Reverse source generation.

PropertyTypeDescription
sourcestr | Path | Mapping[str, Any]

Canonical YAML input.

Required
output_dirstr | Path

New package root.

Required
returnPath

Generated package main.py.

yaml_to_api_document() properties

Designer-compatible JSON conversion.

PropertyTypeDescription
sourceYAML str | Path | Mapping

Canonical topology input.

Required
returndict[str, Any]

Flat settings, streams, services, dataConnectors, endpoints, types, links, pools, and modules payload.

Python example

entrypoint = yaml_to_python_project(
    "architecture.yaml", "generated_orders"
)
payload = yaml_to_api_document("architecture.yaml")