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.1.tar.gz (21.7 kB view details)

Uploaded Source

Built Distribution

mermaid_py-0.6.1-py3-none-any.whl (31.5 kB view details)

Uploaded Python 3

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

Hashes for mermaid_py-0.6.1.tar.gz
Algorithm Hash digest
SHA256 38cf1573b589772c0d6135044683bf44706f2ea9fcacfa573c337cbdc5d86f99
MD5 ce6575046e42ee437e5d3a14eeb0811e
BLAKE2b-256 0b4cc705cc6800e43deaad67ace07b7e1f86324f9c30cb4397556d0a85a13d45

See more details on using hashes here.

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

Hashes for mermaid_py-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e22bf98c293954349083c63e6c0c60675a83152fb564248bfc81dadcfe5a8303
MD5 7b5abfaed25e38c436a1678241578487
BLAKE2b-256 f717d05436847bfbf8828590e9c5e24875ed80e36f7f67c02169d6428bc5f6cd

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