Skip to main content

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

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

modwire_mermaid-0.1.0.tar.gz (30.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

modwire_mermaid-0.1.0-py3-none-any.whl (41.7 kB view details)

Uploaded Python 3

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

Hashes for modwire_mermaid-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7bc21430adc6de124d1146149cb518f3f88a174dbb40dc00821cbbaef96502af
MD5 97292917b84ef94d118af684ca276227
BLAKE2b-256 83372ec9782f69399717c89eef624af58f23389247f89cc20be1e616f14cf088

See more details on using hashes here.

Provenance

The following attestation bundles were made for modwire_mermaid-0.1.0.tar.gz:

Publisher: release.yml on 9orky/modwire-mermaid

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for modwire_mermaid-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e8bfa206d27cfca100473b80ac90156f2b6b2376558d878421e65dada2716284
MD5 992db65da20194fe6a942e9734e5dc17
BLAKE2b-256 5f0bcbbded06f0d473e6ed21bc44e54bf3be749bd59e4b8145c6cc1b0f8a2656

See more details on using hashes here.

Provenance

The following attestation bundles were made for modwire_mermaid-0.1.0-py3-none-any.whl:

Publisher: release.yml on 9orky/modwire-mermaid

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page