Python Interface for the Popular mermaid-js Library, Simplified for Diagram Creation.
Maintained. Last release 2 months ago, commits in 2 of the last 26 weeks. Weaker on commit activity and contributor spread.
pip install mermaid-pyMermaid-py
this package works as an interface for the famous mermaid-js library that uses scripts to create diagrams.
Description
mermaid-py is a dynamic Python library designed to serve as a seamless interface for the renowned Mermaid library. Built upon the powerful capabilities of Python, mermaid-py empowers developers and data enthusiasts to effortlessly create stunning diagrams, flowcharts, and visualizations directly within their Python environments.
Examples
first install the package using pip:
pip install mermaid-py
- using
MermaidandGraphclasses:
import mermaid as md
from mermaid.graph import Graph
render = md.Mermaid("""
stateDiagram-v2
[*] --> Still
Still --> [*]
Still --> Moving
Moving --> Still
Moving --> Crash
Crash --> [*]
""")
render # !! note this only works in the notebook that rendered the html.
- using
mermaidjsmagic function in a notebook firstimport mermaid as md:
%%mermaidjs # with --img flag in case your notebook doesn't render HTML
flowchart LR
A-->B
B-->C