Skip to content

lmmx/aws-step-functions-pydantic

Repository files navigation

aws-step-functions-pydantic

CI Status Coverage Checked with mypy Code style: black

Pydantic models for AWS step functions

Usage

From Step Function ARN

Use the from_arn() class constructor

from aws_sfn_pydantic import StateMachine

sfn = StateMachine.from_arn(state_machine_arn="...")

From JSON

Use the model_validate_json() class constructor (Pydantic v2 builtin)

from aws_sfn_pydantic import StateMachine

sfn = StateMachine.model_validate_json("...")

To YAML

Use the to_yaml() class constructor, which accepts:

  • indent (default: 2)
  • level (default: 0)
print(sfn.model_to_yaml())

Requires

  • Python 3.10+

Installation

pip install aws-step-functions-pydantic

aws-step-functions-pydantic is available from PyPI, and the code is on GitHub

About

Pydantic models for AWS step functions

Resources

License

Stars

Watchers

Forks

Packages

No packages published