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-1.0.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-1.0.0-py3-none-any.whl (41.7 kB view details)

Uploaded Python 3

File details

Details for the file modwire_mermaid-1.0.0.tar.gz.

File metadata

  • Download URL: modwire_mermaid-1.0.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-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d040a5c3bd50e612016048bcc1e406b9a8742571597ab2610c90ad72d353a802
MD5 dae941d6f67518e36090346ee48808e0
BLAKE2b-256 360db5b5c6a2f0e75db075141bcd66cc68b14de00d39de38dcec21ec53afb4cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for modwire_mermaid-1.0.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-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: modwire_mermaid-1.0.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-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b1db6fae1ec5202206b2c68f600d764e8b4a386dbb57e4f6b7682a6380df65b7
MD5 eeb84968172c48bf3aa2972ac40c7dac
BLAKE2b-256 abd2fbf05883512b8b4f346d465777d797528ef32e339851a5fe80d6a0959c9e

See more details on using hashes here.

Provenance

The following attestation bundles were made for modwire_mermaid-1.0.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