Skip to main content

Module emit_models

Module emit_models 

Source
Expand description

Model emission for IR schemas (Python dataclasses/enums/aliases).

Uses sigil-stitch high-level APIs (TypeSpec, FieldSpec, FunSpec, TypeName, sigil_quote!) for structured code generation with automatic import tracking. Each schema produces one .py file via FileSpec.

Functionsยง

api_type_name
Like python_type_name but Named types import from ..models.{snake} (for API files).
future_annotations_header
generate_model_files
Generate every model file from the IR.
is_object_schema
python_field_name
python_type_name
Map an IR type expression to a sigil-stitch TypeName with auto-import tracking.
python_type_str
Map an IR type expression to a Python type string (for serialization helpers).