Metadata-Version: 2.4
Name: python-to-mermaid
Version: 0.6.0
Summary: Generate Mermaid diagrams using Python code
Project-URL: Bug Tracker, https://github.com/python-to-mermaid/python-to-mermaid/issues
Project-URL: Homepage, https://github.com/python-to-mermaid/python-to-mermaid
Author: python-to-mermaid
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.7
Requires-Dist: pytest>=7.4.4
Description-Content-Type: text/markdown

# python-to-mermaid

Generate [Mermaid diagrams](https://mermaid.js.org/) using Python code.

## Installation

### UV

```bash
uv add python-to-mermaid
```

### Pip

```bash
pip install python-to-mermaid
```

## Usage

```python
from python_to_mermaid import MermaidDiagram

diagram = MermaidDiagram()
diagram.add_node("A")
diagram.add_node("B")
diagram.add_edge("A", "B")

mermaid_diagram = str(diagram)
# flowchart TD
#     A
#     B
#     A --> B
```

```mermaid
flowchart TD
    A
    B
    A --> B
```

## Examples

See the [examples](examples) directory for more examples.

- [Node with Text](examples/node_with_text.md)
- [Node Shapes](examples/node_shapes.md)

## Development

```bash
uv sync
```

## Testing

```bash
pytest tests/ -v
```

## Publishing

```bash
./publish.sh
```

```bash
chmod +x publish.sh
```

### Generate Examples

```bash
python examples
```
