Pydantic models for AWS step functions
Use the from_arn() class constructor
from aws_sfn_pydantic import StateMachine
sfn = StateMachine.from_arn(state_machine_arn="...")Use the model_validate_json() class constructor (Pydantic v2 builtin)
from aws_sfn_pydantic import StateMachine
sfn = StateMachine.model_validate_json("...")Use the to_yaml() class constructor, which accepts:
indent(default: 2)level(default: 0)
print(sfn.model_to_yaml())- Python 3.10+
pip install aws-step-functions-pydanticaws-step-functions-pydantic is available from PyPI, and the code is on GitHub