Metadata-Version: 2.5
Name: yaddd-utils
Version: 0.1.0
Summary: Utilities for yaddd: scenario inspection and Mermaid diagram generation.
Project-URL: Homepage, https://github.com/netstuff/yaddd
Author-email: Yuri Andreev <andreev.jr@gmail.com>
License-Expression: MIT
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.12
Requires-Dist: mermaid-py>=0.7
Requires-Dist: yaddd>=0.3
Description-Content-Type: text/markdown

# yaddd-utils

Utilities for [yaddd](https://github.com/netstuff/yaddd): scenario inspection and Mermaid diagram generation.

## Features

- **Scenario inspection** — discover `yaddd` `Scenario` subclasses, their steps, branches and conditions.
- **Mermaid renderers** — turn inspected scenarios into diagrams:
  - flowchart per scenario;
  - grouped flowchart with subgraphs;
  - sequence diagram of step execution;
  - state diagram for `State` subclasses.

## Installation

```bash
pip install yaddd-utils
```

## CLI

Render a Mermaid flowchart from a Python module containing scenarios:

```bash
yaddd-mermaid myapp.scenarios --output diagram.mmd
```

## API

```python
from yaddd_utils.inspect import ScenarioAnalyzer
from yaddd_utils.mermaid import ScenarioRenderer, RenderOptions

analyzer = ScenarioAnalyzer()
model = analyzer.analyze_module("myapp.scenarios")

renderer = ScenarioRenderer(RenderOptions(direction="TD"))
print(renderer.render(model))
```
