Skip to main content

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.

Code Coverage GitHub LICENSE Mounthly Download latest version supported python version ruff badge mermaid-py on snyk

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 and Graph 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.

Example Flowchart

  • using mermaidjs magic function in a notebook first import mermaid as md:
%%mermaidjs # with --img flag in case your notebook doesn't render HTML
flowchart LR
    A-->B
    B-->C

Example Flowchart

  • using FlowChart etc ...
from mermaid import *
from mermaid.flowchart import *

diagram = Mermaid(Flowchart(...))

diagram

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 rachidouhammou21@gmail.com.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mermaid_py-0.6.0.tar.gz (21.7 kB view details)

Uploaded Source

Built Distribution

mermaid_py-0.6.0-py3-none-any.whl (31.4 kB view details)

Uploaded Python 3

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

Hashes for mermaid_py-0.6.0.tar.gz
Algorithm Hash digest
SHA256 840434ef736a51d3f56287e60cf5ab703b6e0d97d2cde1029135f0b56aff02ae
MD5 82f6d125a82b656309686ec1ac0a5745
BLAKE2b-256 d942690a72607f6f156f8a279f185e6525320b087aa454a9cd12a2d4065d4993

See more details on using hashes here.

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

Hashes for mermaid_py-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0ab91d5c130ab500c64cc293e78c96fe11f00a3e66991089231fe7789ec7b2cb
MD5 c66d0182b1865fbd95dedfce3515026f
BLAKE2b-256 1580948044ace4e25a0da9f98cb34a06b119cbf338eb1c0be26a88e14dbcad7e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page