Python bindings for mermaid-rs-renderer - Fast Mermaid diagram rendering in Rust
Project description
mermaid-rs
Python bindings for mermaid-rs-renderer - a fast native Rust Mermaid diagram renderer.
Features
- Fast: 500-1000x faster than mermaid-cli (no browser required)
- 13 diagram types: flowchart, sequence, class, state, ER, pie, xy chart, quadrant, gantt, timeline, journey, mindmap, git graph
- Pure Rust: ~3ms cold start vs ~2500ms for mermaid-cli
- Low memory: ~15MB vs ~300MB for mermaid-cli
Installation
pip install mermaid-rs
Usage
import mermaid_rs
# Simple rendering
svg = mermaid_rs.render("""
flowchart LR
A[Start] --> B{Decision}
B -->|Yes| C[OK]
B -->|No| D[Cancel]
""")
# With options
svg = mermaid_rs.render(
"flowchart TD; A-->B-->C",
theme="modern", # or "mermaid_default"
node_spacing=60.0,
rank_spacing=80.0,
)
# With timing info
svg, parse_us, layout_us, render_us, total_us = mermaid_rs.render_with_timing(
"flowchart LR; A-->B"
)
print(f"Rendered in {total_us/1000:.2f}ms")
# List supported diagrams
print(mermaid_rs.supported_diagram_types())
Supported Diagram Types
- Flowcharts (
flowchart/graph): TD, TB, LR, RL, BT directions - Sequence Diagrams (
sequenceDiagram) - Class Diagrams (
classDiagram) - State Diagrams (
stateDiagram-v2) - ER Diagrams (
erDiagram) - Pie Charts (
pie) - XY Charts (
xychart) - Quadrant Charts (
quadrantChart) - Gantt (
gantt) - Timeline (
timeline) - Journey (
journey) - Mindmap (
mindmap) - Git Graph (
gitGraph)
License
MIT
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_rs-0.1.0.tar.gz
(18.0 kB
view details)
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 mermaid_rs-0.1.0.tar.gz.
File metadata
- Download URL: mermaid_rs-0.1.0.tar.gz
- Upload date:
- Size: 18.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"25.10","id":"questing","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e35da91b7c85b105d4a01ec105f146d8296d26fd1b2cf65f82d80ab773f7e0a2
|
|
| MD5 |
b953b46c5b5efb097958186a1dfddfc3
|
|
| BLAKE2b-256 |
fa8ef7f7103b5391fa8a311c05b3ea1b45786faa28e3de222634a38c5d29a77d
|
File details
Details for the file mermaid_rs-0.1.0-cp314-cp314-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: mermaid_rs-0.1.0-cp314-cp314-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 2.0 MB
- Tags: CPython 3.14, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"25.10","id":"questing","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3cec2c75aac0a3d20052a358d85dcf30e812365a6e7f3d4a684150a859da79f
|
|
| MD5 |
9662836f7b10ecb89094430e4572f7ad
|
|
| BLAKE2b-256 |
adf96b90235f4a862f5aad6c2fe65170c09b376cc9b56f63d1475eb328e52784
|