Render Mermaid diagrams from Python — no Node.js required
Project description
mermaido
Render Mermaid diagrams from Python — no Node.js required.
mermaido bundles Node.js via nodejs-bin and wraps mermaid-cli so you can generate diagrams without managing any JavaScript tooling yourself.
Install
pip install mermaido
mermaido install
or with uv:
uv add mermaido
uv run mermaido install
The mermaido install step downloads mermaid-cli and Chromium (~200 MB) into a local cache. You only need to run it once.
Python API
import mermaido
# Render to a file
mermaido.render("graph TD; A-->B;", "output.png")
mermaido.render("graph TD; A-->B;", "output.svg", fmt="svg")
# Render to a string
svg = mermaido.render_to_string("graph TD; A-->B;")
CLI
mermaido is a drop-in replacement for mmdc:
mermaido -i diagram.mmd -o output.svg
mermaido -i diagram.mmd -o output.png -t dark
mermaido --help
Configuration
| Environment variable | Default | Description |
|---|---|---|
MERMAIDO_MMDC_VERSION |
11.4.2 |
mermaid-cli version to install |
How it works
pip install mermaidoinstalls the Python package and a bundled Node.js binary (vianodejs-bin).mermaido installuses that bundled Node.js tonpm installmermaid-cli and Chromium into a cache directory (~/.cache/mermaidoon Linux, platform-appropriate elsewhere).mermaido.render()or themermaidoCLI invokesmmdcfrom that cache.
No system-wide Node.js or npm installation is needed.
License
MIT
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mermaido-0.1.0.tar.gz.
File metadata
- Download URL: mermaido-0.1.0.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f774dd8d422bebc845aa3c62d57376de1cc0f2dc310ebeea34fa76f92640d5b5
|
|
| MD5 |
a648515f3a3529636f2a5f951e4060f4
|
|
| BLAKE2b-256 |
adc3d33f8ed091e1e0f3e644940805729d8c9713cad3dbd2bafaff53bee073d9
|
Provenance
The following attestation bundles were made for mermaido-0.1.0.tar.gz:
Publisher:
publish.yml on stano45/mermaido
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mermaido-0.1.0.tar.gz -
Subject digest:
f774dd8d422bebc845aa3c62d57376de1cc0f2dc310ebeea34fa76f92640d5b5 - Sigstore transparency entry: 976487153
- Sigstore integration time:
-
Permalink:
stano45/mermaido@dcf7ea178bd20e2393c5cec0d8c643f6ebf138ea -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/stano45
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dcf7ea178bd20e2393c5cec0d8c643f6ebf138ea -
Trigger Event:
push
-
Statement type:
File details
Details for the file mermaido-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mermaido-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
620d209d23da0c048bfb0f860e8beb8c27e0bab11321ea896f8f28b979c27b18
|
|
| MD5 |
c4bfa3bf44dbac77ac8df0acef84cb4d
|
|
| BLAKE2b-256 |
8834d332f3eaf7e59a64301eaf4518280c4957c5607507d31c7af739d6a4feaf
|
Provenance
The following attestation bundles were made for mermaido-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on stano45/mermaido
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mermaido-0.1.0-py3-none-any.whl -
Subject digest:
620d209d23da0c048bfb0f860e8beb8c27e0bab11321ea896f8f28b979c27b18 - Sigstore transparency entry: 976487154
- Sigstore integration time:
-
Permalink:
stano45/mermaido@dcf7ea178bd20e2393c5cec0d8c643f6ebf138ea -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/stano45
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dcf7ea178bd20e2393c5cec0d8c643f6ebf138ea -
Trigger Event:
push
-
Statement type: