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 🔥
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.0.tar.gz
.
File metadata
- Download URL: mermaid_py-0.6.0.tar.gz
- Upload date:
- Size: 21.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.14 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 840434ef736a51d3f56287e60cf5ab703b6e0d97d2cde1029135f0b56aff02ae |
|
MD5 | 82f6d125a82b656309686ec1ac0a5745 |
|
BLAKE2b-256 | d942690a72607f6f156f8a279f185e6525320b087aa454a9cd12a2d4065d4993 |
File details
Details for the file mermaid_py-0.6.0-py3-none-any.whl
.
File metadata
- Download URL: mermaid_py-0.6.0-py3-none-any.whl
- Upload date:
- Size: 31.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.14 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ab91d5c130ab500c64cc293e78c96fe11f00a3e66991089231fe7789ec7b2cb |
|
MD5 | c66d0182b1865fbd95dedfce3515026f |
|
BLAKE2b-256 | 1580948044ace4e25a0da9f98cb34a06b119cbf338eb1c0be26a88e14dbcad7e |