Expand description
Python stack SDK generation.
Mirror of crate::rust emitting a Python package next to the TS/Rust
outputs (see docs/internal/sdk-python-alignment.md §4). The generated
package instantiates the arete runtime’s binding model
(arete.stack.StackDef / ProgramDef, arete.views.ViewDef) as pure
data + pure functions:
__init__.py—<STACK_NAME>_STACK: StackDefbinding + re-exports.models.py— entity dataclasses +*_from_wire/*_patch_from_wireconverters (snake_case pass-through, u64 decimal strings →int, nested structs).views.py— typed view namespace classes + theVIEWSmap consumed byStackDef.programs.py— per-program<Ix>ParamsTypedDicts, raw builders, raw*_handler()escape hatches, PDA factories, typed account read definitions, release identity consts +*_read_descriptor(), error metadata tables, and thePROGRAMS/PROGRAM_READSmaps.
Structs§
- Python
Aliased Stack Output - Python
Composition Config - Python
Composition Output - Python
Output - Python
Program Read Config - Python
Stack Config
Functions§
- compile_
composed_ public_ artifacts_ v2 - Generate one namespaced Python stack package per live alias plus a root
__init__.pythat preserves alias boundaries instead of flattening views/adapters. - compile_
public_ artifacts - Compile Python output from an explicit StackManifest and its public dependencies.
- compile_
public_ artifacts_ v2 - Compile typed V2 public artifacts through the current single-live generator.
- compile_
stack_ spec - Compile a full SerializableStackSpec (multi-entity) into a Python package.
- compile_
stack_ spec_ with_ exact_ views - Compile a stack model whose
viewshave already been projected by a StackManifest selected-view allowlist. - python_
module_ name - Derive a valid Python module name from an arbitrary alias or file stem
(lowercased, non-alphanumerics collapsed to
_, keywords and leading digits escaped). Shared with the CLI so staged devex extension files wire up under the same stems the composition generator would use. Mirror ofcrate::rust::rust_module_name. - write_
python_ composition_ module - write_
python_ composition_ package - write_
python_ module - Write a plain source package directory (dropped into a user’s project):
__init__.py,models.py,views.py, andprograms.pywhen generated. - write_
python_ package - Write a pip-installable layout:
pyproject.tomlplus the import package directory (mirror ofwrite_rust_crate’s packaging wrapper).