skillfed

mermaid-builder

MermaidJS markup builder for Python

mermaid-builder v0.0.3 437.4K downloads/30d#6,669 on PyPI4
Permissive license DORMANT released

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-builder

uv

uv add mermaid-builder

poetry

poetry add mermaid-builder

Installing 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

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

mermaid diagram generation pythonflowchart builder programmaticsequence diagram markup buildermermaidjs syntax generatordiagram as code python
diagram-as-codemermaidjs

More Markup packages