Python Interface for the Popular mermaid-js Library, Simplified for Diagram Creation.
Project description
Mermaid-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
Mermaid
andGraph
classes:
import mermaid as md
from mermaid.graph import Graph
sequence = Graph('Sequence-diagram',"""
stateDiagram-v2
[*] --> Still
Still --> [*]
Still --> Moving
Moving --> Still
Moving --> Crash
Crash --> [*]
""")
render = md.Mermaid(sequence)
render # !! note this only works in the notebook that rendered the html.
- using
mermaidjs
magic 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
- using
FlowChart
etc ...
from mermaid import *
from mermaid.flowchart import *
diagram = Mermaid(Flowchart(...))
diagram
- more examples on mermaid and test-mermaid
List of Diagrames
-
FlowChart -
Sequence Diagram - Class Diagram
-
State Diagram -
Entity Relationship Diagram -
User Journey - Gantt
-
Pie Chart - Quadrant Chart
-
Requirement Diagram - Gitgraph (Git) Diagram
- C4 Diagram 🦺⚠️
-
Mindmaps - Timeline
- Zenuml
- Sankey
- XYChart 🔥
- Block Diagram 🔥
- Packet 🔥
- Architecture 🔥
License
This project is licensed under the MIT License.
Contact
If you have any questions or want to get in touch, you can reach out to me at rachidouhammou21@gmail.com.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mermaid_py-0.6.1.tar.gz
.
File metadata
- Download URL: mermaid_py-0.6.1.tar.gz
- Upload date:
- Size: 21.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38cf1573b589772c0d6135044683bf44706f2ea9fcacfa573c337cbdc5d86f99 |
|
MD5 | ce6575046e42ee437e5d3a14eeb0811e |
|
BLAKE2b-256 | 0b4cc705cc6800e43deaad67ace07b7e1f86324f9c30cb4397556d0a85a13d45 |
File details
Details for the file mermaid_py-0.6.1-py3-none-any.whl
.
File metadata
- Download URL: mermaid_py-0.6.1-py3-none-any.whl
- Upload date:
- Size: 31.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e22bf98c293954349083c63e6c0c60675a83152fb564248bfc81dadcfe5a8303 |
|
MD5 | 7b5abfaed25e38c436a1678241578487 |
|
BLAKE2b-256 | f717d05436847bfbf8828590e9c5e24875ed80e36f7f67c02169d6428bc5f6cd |