Typed deterministic Mermaid diagrams and local rendering for Modwire.
Project description
modwire-mermaid
Typed, frozen, deterministic Mermaid text diagrams behind one class-based API. The package returns validated Mermaid source and performs no filesystem, browser, CLI, or image-rendering work.
Compilation is package-native. It does not depend on Node.js or mermaid-py; consumers may pass the
generated source to their preferred Mermaid renderer or validation binary.
Public API
The supported root imports below are generated from modwire_mermaid.__all__.
| Symbol | Purpose | Primary API |
|---|---|---|
ModwireDiagramError |
Report an invalid diagram contract or unsupported diagram operation. | — |
ModwireMermaid |
Compile validated Modwire diagram contracts into deterministic Mermaid source. | compile(diagram: modwire_mermaid.contracts.ModwireBaseDiagram) -> str |
ModwireMermaidFactory |
Build the standard Mermaid façade with every bundled diagram compiler. | standard() -> modwire_mermaid.facade.ModwireMermaid |
__version__ |
Installed distribution version. | — |
Executable example
Source: compile_timeline.py. This file is executed by the test suite.
from modwire_mermaid import ModwireMermaidFactory
from modwire_mermaid.timeline.diagram import ModwireTimelineBuilder
diagram = (
ModwireTimelineBuilder.create("Release history")
.section("2026")
.period("Q1", "Private beta")
.period("Q2", "Public release", "Documentation")
.build()
)
source = ModwireMermaidFactory.standard().compile(diagram)
Diagrams
- Architecture
- Class diagram
- Event modeling
- File tree
- Flowchart
- Mindmap
- Sequence diagram
- State diagram
- Swimlanes
- Timeline
- User journey
All contracts inherit ModwireBaseDiagram. It enforces required children, unique child identities,
and valid references consistently. Empty strings and tuples explicitly represent Mermaid features
that are absent; public contracts are non-nullable and have no implicit defaults.
Development and release
Run uv sync --all-groups and make verify. Releases use strict SemVer tags and PyPI Trusted
Publishing configured for repository 9orky/modwire-mermaid, workflow release.yml, and environment
pypi.
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
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 modwire_mermaid-0.1.0.tar.gz.
File metadata
- Download URL: modwire_mermaid-0.1.0.tar.gz
- Upload date:
- Size: 30.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7bc21430adc6de124d1146149cb518f3f88a174dbb40dc00821cbbaef96502af
|
|
| MD5 |
97292917b84ef94d118af684ca276227
|
|
| BLAKE2b-256 |
83372ec9782f69399717c89eef624af58f23389247f89cc20be1e616f14cf088
|
Provenance
The following attestation bundles were made for modwire_mermaid-0.1.0.tar.gz:
Publisher:
release.yml on 9orky/modwire-mermaid
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
modwire_mermaid-0.1.0.tar.gz -
Subject digest:
7bc21430adc6de124d1146149cb518f3f88a174dbb40dc00821cbbaef96502af - Sigstore transparency entry: 2140111977
- Sigstore integration time:
-
Permalink:
9orky/modwire-mermaid@2f4a70ff5a002a7a8530048c6492fbfb4f5d8e5c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/9orky
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2f4a70ff5a002a7a8530048c6492fbfb4f5d8e5c -
Trigger Event:
release
-
Statement type:
File details
Details for the file modwire_mermaid-0.1.0-py3-none-any.whl.
File metadata
- Download URL: modwire_mermaid-0.1.0-py3-none-any.whl
- Upload date:
- Size: 41.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8bfa206d27cfca100473b80ac90156f2b6b2376558d878421e65dada2716284
|
|
| MD5 |
992db65da20194fe6a942e9734e5dc17
|
|
| BLAKE2b-256 |
5f0bcbbded06f0d473e6ed21bc44e54bf3be749bd59e4b8145c6cc1b0f8a2656
|
Provenance
The following attestation bundles were made for modwire_mermaid-0.1.0-py3-none-any.whl:
Publisher:
release.yml on 9orky/modwire-mermaid
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
modwire_mermaid-0.1.0-py3-none-any.whl -
Subject digest:
e8bfa206d27cfca100473b80ac90156f2b6b2376558d878421e65dada2716284 - Sigstore transparency entry: 2140112000
- Sigstore integration time:
-
Permalink:
9orky/modwire-mermaid@2f4a70ff5a002a7a8530048c6492fbfb4f5d8e5c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/9orky
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2f4a70ff5a002a7a8530048c6492fbfb4f5d8e5c -
Trigger Event:
release
-
Statement type: