mermaid-builder
MermaidJS markup builder for Python
What it is and what it does
mermaid-builder is a Python library that constructs MermaidJS diagram markup through object-oriented method chaining rather than manual string writing. It provides classes for Chart, Node, Link, Subgraph, SequenceDiagram, Participant, and Message, allowing you to build flowcharts and sequence diagrams programmatically and output valid MermaidJS syntax for rendering in Markdown, GitHub, or the MermaidJS playground.
The library has no external dependencies and supports Python 3.5+. It is designed to make diagram creation less error-prone and more maintainable when you need to generate diagrams dynamically or from data structures, rather than hand-writing diagram syntax. The project is in early stages (version 0.0.3) and dormant since June 2024, with some planned features still incomplete.
Use it for:
- Generate flowcharts programmatically from application logic or configuration data.
- Build sequence diagrams dynamically to document API interactions or system flows.
- Create nested subgraphs and complex diagram structures without manual string escaping.
- Embed diagram generation in documentation pipelines or automated reporting tools.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Programmatically generates MermaidJS diagram markup (flowcharts, sequence diagrams) as Python objects, avoiding manual string concatenation of diagram syntax.
Yes, if you need to generate MermaidJS diagrams programmatically and accept early-stage tooling. No external dependencies and permissive licensing make it low-risk to try. However, dormancy since June 2024 and version 0.0.3 mean incomplete features and potential gaps; verify that flowchart and sequence diagram support covers your use case before committing to it in production.
Install
mermaid-builder on PyPI
pip
pip install mermaid-builderuv
uv add mermaid-builderpoetry
poetry add mermaid-builderInstalling mermaid-builder
Before you install
Low install friction with no runtime dependencies. Project is dormant since June 2024 with minimal maintenance signal, though the repository remains active and unarchived.
License in practice
MIT license permits commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install mermaid-builder
from mermaid_builder import Chart, Node, Link
chart = Chart(title='example')
chart.add_node('start').add_node('end').add_link_between('start', 'end')
print(chart)
Requires Python 3.5 or later.
Verify before relying
- Whether the package handles all MermaidJS diagram types beyond flowcharts and sequence diagrams.
- Current state of the 'clone with prefix' and 'class diagrams' features listed as incomplete in the description.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.5) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 791 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 437,357/month — #6,669 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: mermaid_builder-0.0.3-py3-none-any.whl
Tags
More Markup packages
PyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
markdown-it-pyA Python markdown parser that converts markdown…
permissive · top 100 on PyPI
beautifulsoup4Beautiful Soup parses HTML and XML documents…
permissive · top 100 on PyPI
et-xmlfileet_xmlfile writes large XML files with minimal…
permissive · top 1,000 on PyPI
tomlkitParses and edits TOML files while preserving…
permissive · top 1,000 on PyPI
docstring-parserParses Python docstrings in ReST, Google,…
permissive · top 1,000 on PyPI
mermaid-pymermaid-py provides a Python interface to the…
permissive · top 15,000 on PyPI
mkdocs-mermaid2-pluginA MkDocs plugin that renders Mermaid diagram…
permissive · top 5,000 on PyPI
sphinxcontrib-mermaidEmbeds Mermaid diagrams (flowcharts, sequence…
permissive · top 5,000 on PyPI
blockdiagblockdiag generates block-diagram images from a…
permissive · top 15,000 on PyPI
django-diagramGenerates Entity Relationship Diagrams in…
unclear · top 15,000 on PyPI
schemdrawSchemdraw generates high-quality electrical…
permissive · top 15,000 on PyPI
plantumlGenerates UML diagrams from text markup by…
permissive · top 15,000 on PyPI
paracelsusParacelsus generates Entity Relationship…
permissive · top 15,000 on PyPI
mkdocs-kroki-pluginA MkDocs plugin that converts Kroki diagram…
permissive · top 15,000 on PyPI
wavedromConverts WaveDrom-compatible JSON…
permissive · top 15,000 on PyPI