Skip to content

A simple interface for the the famous lib mermaid-js to create diagrams.

License

Notifications You must be signed in to change notification settings

lachniej/mermaid-py

 
 

Repository files navigation

Mermaid-py

this package works as an interface for the famous mermaid-js library that uses scripts to create diagrams.

Code Coverage GitHub LICENSE Contributors

Description

Briefly describe your project here. Explain what it does and what makes it special.

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: Mermaid = 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
Loading

Technologies Used

  • Python3
  • Poetry

To contribute to mermaid-py

If you'd like to contribute to this open source project folow this steps:

  1. Forke the repo and then clone it.
  2. Navigate to the project directory: cd mermaid-py.
  3. create a local enviroment python3 -m venv env.
  4. activate the env source env/bin/activate.
  5. install the dependecies poetry install.
  6. happy coding :) .

List of Diagrames

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 [email protected].

About

A simple interface for the the famous lib mermaid-js to create diagrams.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.4%
  • Makefile 0.6%