Metadata-Version: 2.1
Name: aws-step-functions-pydantic
Version: 0.0.5
Summary: Pydantic models for AWS step functions
Author-Email: Louis Maddox <louismmx@gmail.com>
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.9
Provides-Extra: dev
Requires-Dist: pdm>=2.22.3; extra == "dev"
Requires-Dist: pdm-bump>=0.9.10; extra == "dev"
Requires-Dist: pre-commit>=4.1.0; extra == "dev"
Description-Content-Type: text/markdown

# aws-step-functions-pydantic

[![CI Status](https://github.com/lmmx/aws-step-functions-pydantic/actions/workflows/master.yml/badge.svg)](https://github.com/lmmx/aws-step-functions-pydantic/actions/workflows/master.yml)
[![Coverage](https://codecov.io/gh/lmmx/aws-step-functions-pydantic/branch/master/graph/badge.svg)](https://codecov.io/github/lmmx/aws-step-functions-pydantic)
[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

Pydantic models for AWS step functions

## Usage

### From Step Function ARN

Use the `from_arn()` class constructor

```py
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)

```py
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)

```py
print(sfn.model_to_yaml())
```

## Requires

- Python 3.10+

## Installation

```sh
pip install aws-step-functions-pydantic
```

> _aws-step-functions-pydantic_ is available from [PyPI](https://pypi.org/project/aws-step-functions-pydantic), and
> the code is on [GitHub](https://github.com/lmmx/aws-step-functions-pydantic)
