Generate Mermaid diagrams using Python code
Project description
python-to-mermaid
Generate Mermaid diagrams using Python code.
Installation
UV
uv add python-to-mermaid
Pip
pip install python-to-mermaid
Usage
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
flowchart TD
A
B
A --> B
Examples
See the examples directory for more examples.
Development
uv sync
Testing
pytest tests/ -v
Publishing
./publish.sh
chmod +x publish.sh
Generate Examples
python examples
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
python_to_mermaid-0.6.0.tar.gz
(13.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python_to_mermaid-0.6.0.tar.gz.
File metadata
- Download URL: python_to_mermaid-0.6.0.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f0d7117d22e865a41cb876defbe1561a25d73d719771066940d1fc3fd93fe73
|
|
| MD5 |
663bfa391bb40670465dbbd6306fffde
|
|
| BLAKE2b-256 |
931f65d920f0d6318bba6cfed08a4a98b36057ff89a9971c1c17bc8e9ad2027d
|
File details
Details for the file python_to_mermaid-0.6.0-py3-none-any.whl.
File metadata
- Download URL: python_to_mermaid-0.6.0-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee5c7b2c5a92272f639feaad02107e50789cad0ba77809bf46202fd0905fdfe7
|
|
| MD5 |
839c21f5ea1937e710ff7a1d650082fc
|
|
| BLAKE2b-256 |
5a878af1593773277b7958fadaa22d65acc77f803430e4a9605a9ba19d60291c
|