A simple interface for the the famous lib mermaid-js to create diagrams.
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 mermaid-py
by pip install mermaid-py
.
import mermaid as md
from mermaid.graph import Graph
graph: Graph = Graph('first-graph',"""
graph TD;
mer(Mermaid)
flow(FlowChart);
clas(ClassDiagram)
gra(Graph)
erDigram(ERDiagram)
erdiagram-link(Link)
entity(Entity)
flow-link(Link)
node(Node)
mer --> flow
mer --> clas
mer --> gra
mer --> erDigram
flow --> node & flow-link
erDigram --> entity & erdiagram-link
""")
graphe: md.Mermaid = md.Mermaid(graph)
graphe # !! note this work just in notbooke that render html.
the result will be like this
graph TD;
mer(Mermaid)
flow(FlowChart);
clas(ClassDiagram)
gra(Graph)
erDigram(ERDiagram)
pie(PieDiagram)
reqDiagram(RequiremntDiagram)
userj(UserJourney)
erdiagram-link(Link)
entity(Entity)
flow-link(Link)
node(Node)
requiremnt(Requiremnt)
element(Element)
actor(Actor)
section(Section)
task(Task)
mer --> flow & clas & gra & erDigram & pie & reqDiagram & userj
flow --> node & flow-link
erDigram --> entity & erdiagram-link
reqDiagram --> requiremnt & element
userj --> actor & section & task
Technologies Used
- Python3
- Poetry
To contribute to mermaid-py
If you'd like to contribute to this open source project folow this steps:
- Forke the repo and then clone it.
- Navigate to the project directory:
cd mermaid-py
. - create a local enviroment
python3 -m venv env
. - activate the env
source env/bin/activate
. - install the dependecies
poetry install
. - happy coding :) .
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 🔥
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.3.0.tar.gz
.
File metadata
- Download URL: mermaid_py-0.3.0.tar.gz
- Upload date:
- Size: 20.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.10.12 Linux/6.5.0-1016-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd5a4a195ad6a6b78d8a8386ddaa93eaa1a7b7647d943697a7460bdb97ce78db |
|
MD5 | 6f8e263a6f11098fe997c97419529019 |
|
BLAKE2b-256 | 2f183e8903219a53bcf9106327eb9478ddd2f54cdc68c9c4729c6e9530d44d9b |
File details
Details for the file mermaid_py-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: mermaid_py-0.3.0-py3-none-any.whl
- Upload date:
- Size: 31.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.10.12 Linux/6.5.0-1016-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 027802fd13f6567ab8baddddeb69178e595de3d5e3a69fa3389f4e65cfe2b700 |
|
MD5 | 5870fcea7b2f1a1c90fa0adca0d6f01d |
|
BLAKE2b-256 | b51ebce56f334c1ff435a9c78bcc144a90cc691c0f6b64719d8fb9412703eceb |