Skip to main content

Mermaid-ASCII (GoLang) wrapped in a Python Package

Project description

mermaid-ascii (PyPI packaging)

This repository rebundles the upstream mermaid-ascii (written in Go) and publishes it to PyPI as a Python package. It exists to make Mermaid → ASCII conversion trivial to install and use from Python and in CI, without requiring Node, Graphviz, or a JVM.

Upstream author: Alexander Grooff This repo is a packaging/redistribution project and is not affiliated with the upstream authors.


What you get

  • A prebuilt mermaid-ascii binary shipped inside the wheel.
  • A tiny Python wrapper for programmatic use (mermaid_to_ascii(...)).
  • Optional CLI access via your Python environment (see Usage).

This lets you:

  • Convert Mermaid diagrams to ASCII in terminals and CI logs
  • Call the converter directly from Python, Jupyter, or scripts

Install

pip install mermaid-ascii

We publish wheels for common platforms. If a wheel isn’t available for your platform yet, please open an issue.


Quick start

CLI

# From a file
mermaid-ascii -i diagram.mmd

# From stdin
echo 'flowchart LR; A-->B' | mermaid-ascii -i -

Python API

from mermaid_ascii import mermaid_to_ascii

src = """
flowchart TB
  A[Start] --> B{Question?}
  B -->|Yes| C[Go]
  B -->|No|  D[Stop]
"""
print(mermaid_to_ascii(src))

Jupyter tip

JupyterLab ≥ 4.1 / Notebook ≥ 7.1 can render Mermaid natively for visual preview:

```mermaid
flowchart LR
  A --> B
```

Use this package when you specifically need ASCII output (for terminals, logs, or text-only artifacts).


Versioning

  • The Python package version matches the upstream mermaid-ascii tag, with a leading v stripped if present (e.g., upstream v0.6.1 → package 0.6.1).
  • Each release of this package corresponds to the latest upstream release at the time of packaging.

How this repo works (release automation)

  1. CI clones the upstream AlexanderGrooff/mermaid-ascii repo and detects its latest tag.

  2. If that version differs from this package’s version in pyproject.toml (annotated with # mermaid-ascii version), CI:

    • Updates pyproject.toml to the new version
    • Builds the upstream Go binary
    • Bundles the binary into the Python wheel
    • Publishes to PyPI
    • Creates a GitHub tag + release in this repo
  3. If nothing changed, CI exits without publishing.

This keeps the PyPI package in lockstep with upstream releases.


Platforms

We aim to provide wheels for:

  • Linux (x86_64, aarch64)
  • macOS (arm64, x86_64)
  • Windows (x86_64)

If your platform isn’t covered, please open an issue with details (OS, architecture, Python version).


Troubleshooting

  • mermaid-ascii: command not found Ensure your Python environment’s bin/Scripts is on PATH. Alternatively, invoke via Python:

    python -m mermaid_ascii -i diagram.mmd
    

    (If unavailable, use the Python API example above.)

  • Non-ASCII terminals Output uses Unicode box-drawing characters. If your terminal can’t display them, switch to a UTF-8–capable font/locale.

  • Diagram doesn’t render as expected Please first confirm the diagram renders in a Mermaid viewer. If the ASCII rendering is the problem, open an issue here; if it’s Mermaid syntax/semantics, consider filing upstream.


Contributing

PRs are welcome for:

  • Additional wheels/platforms
  • CI improvements
  • Small Python wrapper enhancements (docs, examples)

License & attribution

  • The included mermaid-ascii binary and its source are licensed by the upstream project.
  • The packaging code in this repository is licensed as stated in this repo’s LICENSE file.
  • © Respect to the upstream author(s). This project simply repackages their work for PyPI distribution.

Maintainers

If you rely on this package, consider starring both this repo and the upstream to support the maintainers.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

mermaid_ascii-1.2.0-cp314-cp314-win_amd64.whl (19.5 MB view details)

Uploaded CPython 3.14Windows x86-64

mermaid_ascii-1.2.0-cp314-cp314-manylinux_2_39_x86_64.whl (9.9 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.39+ x86-64

mermaid_ascii-1.2.0-cp314-cp314-macosx_15_0_arm64.whl (9.5 MB view details)

Uploaded CPython 3.14macOS 15.0+ ARM64

mermaid_ascii-1.2.0-cp313-cp313-win_amd64.whl (19.3 MB view details)

Uploaded CPython 3.13Windows x86-64

mermaid_ascii-1.2.0-cp313-cp313-manylinux_2_39_x86_64.whl (9.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ x86-64

mermaid_ascii-1.2.0-cp313-cp313-macosx_15_0_arm64.whl (9.5 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

mermaid_ascii-1.2.0-cp312-cp312-win_amd64.whl (19.3 MB view details)

Uploaded CPython 3.12Windows x86-64

mermaid_ascii-1.2.0-cp312-cp312-manylinux_2_39_x86_64.whl (9.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

mermaid_ascii-1.2.0-cp312-cp312-macosx_15_0_arm64.whl (9.5 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

mermaid_ascii-1.2.0-cp311-cp311-win_amd64.whl (19.3 MB view details)

Uploaded CPython 3.11Windows x86-64

mermaid_ascii-1.2.0-cp311-cp311-manylinux_2_39_x86_64.whl (9.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ x86-64

mermaid_ascii-1.2.0-cp311-cp311-macosx_15_0_arm64.whl (9.5 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

mermaid_ascii-1.2.0-cp310-cp310-win_amd64.whl (19.3 MB view details)

Uploaded CPython 3.10Windows x86-64

mermaid_ascii-1.2.0-cp310-cp310-manylinux_2_39_x86_64.whl (9.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.39+ x86-64

mermaid_ascii-1.2.0-cp310-cp310-macosx_15_0_arm64.whl (9.5 MB view details)

Uploaded CPython 3.10macOS 15.0+ ARM64

File details

Details for the file mermaid_ascii-1.2.0-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-1.2.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 af1f836754b1375ab7c109924dd520b6a9926602eb4e39c4b772eefe6f78aa0d
MD5 f776ea041f442e11b1267a1348b292e2
BLAKE2b-256 afb65e815ac9fbd5d743695b2db70e0986835534e4739b14444355478e1cf850

See more details on using hashes here.

File details

Details for the file mermaid_ascii-1.2.0-cp314-cp314-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-1.2.0-cp314-cp314-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 9b265ebaf40d6c59041d7f1f31dd5486a04c7cdb624c417f5d57ac122d738afd
MD5 92123f3871598104a29d0d881fa52802
BLAKE2b-256 03f751e9d8552af2991573f34f0e3f125468c5317f96b5f35fc82d17551f3ac1

See more details on using hashes here.

File details

Details for the file mermaid_ascii-1.2.0-cp314-cp314-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-1.2.0-cp314-cp314-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 49c72145cb00535d161d11e3d0ca317eadf9a4e751f53bff9ba3bf8d104d0ca3
MD5 5bf7c7601f7eac6b736e252e1d830e07
BLAKE2b-256 7131b5245686cc95a384afd85b2a675fb728d127b241ede9f6e7b4acbfc68d0e

See more details on using hashes here.

File details

Details for the file mermaid_ascii-1.2.0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-1.2.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 9e8587e27edac01cad3a766bf47c95573532acbbbf19d680aff685ee97edddb2
MD5 02e4141906c71e5bdf255c9586c2f51b
BLAKE2b-256 9a263c42ff3f6369c46909593f2ad84c204d6829347bfeea368b0443a146eb8c

See more details on using hashes here.

File details

Details for the file mermaid_ascii-1.2.0-cp313-cp313-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-1.2.0-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 9f394a3bf23b01435cd0b1ee18c5ba25bbcf214a5a8c2a988d6eef92e47b1dd1
MD5 78ffad0c530045c99f26e1e887bc1a59
BLAKE2b-256 41b52f75928e47107268f50e29e7a06636f52b74135eaec380a0442d23f38414

See more details on using hashes here.

File details

Details for the file mermaid_ascii-1.2.0-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-1.2.0-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 11bbf8e4f143802bef9e3c251e3eb69c9ac94d4d0d7e10a203475e0498910d69
MD5 f3992938aaf672c372e086b22b907ada
BLAKE2b-256 7346166ad4b3224fae05459ee8043d97bb51d1a1abedac1e50cf68a23e2cdc58

See more details on using hashes here.

File details

Details for the file mermaid_ascii-1.2.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-1.2.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6081cc8d90df717887505c9fb8fa0481c03f2f4ffdd927e20ee278f31e841ca0
MD5 0a19f1619c7ca979ddb25089d50c7563
BLAKE2b-256 5ba189b6a6dc0fdfc2120c5df7a9b45e1289a5da88e6a4b771985969f452c465

See more details on using hashes here.

File details

Details for the file mermaid_ascii-1.2.0-cp312-cp312-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-1.2.0-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 767f1cd2c056d2e8e7b8ec9cc421504623d6230539beb85834a6128ea5461312
MD5 290db1b47e0339f1ec6f9212dac7acdb
BLAKE2b-256 5a1ff14c062e9819b5261ee32d39922ccd53a643c638583732a441aea0c2e137

See more details on using hashes here.

File details

Details for the file mermaid_ascii-1.2.0-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-1.2.0-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 f42fba950a84997efd3c9c332ac215f70f4735a76bd86aa96f479c51a06b9f2a
MD5 8801f3673bbd0b315893d4472056675f
BLAKE2b-256 6c9aea2db564f79e173303dc87366415e01af0da82f42f3e7244870e16b04fbc

See more details on using hashes here.

File details

Details for the file mermaid_ascii-1.2.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-1.2.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 9222e93b21bd92c815fb9b272401a302c6f89fd865c437b5dd491482e10b0529
MD5 79f7e4c14058a0c735cb685717b61dcd
BLAKE2b-256 dcd870866e13ebad0f5a33bdc5a2d8d18fc45a1deabbb27b1b52fe51ce948977

See more details on using hashes here.

File details

Details for the file mermaid_ascii-1.2.0-cp311-cp311-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-1.2.0-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 79e137f9c7e1b1df2b3ba90817b8c0db120e6db1bc1f292ae77901f2ec33ee08
MD5 38a612a91ecf561325ff91ecd6d7f920
BLAKE2b-256 78d84c0602e4ace67005afdb1b6e8fb7a31c7ac4f286caebbdc91e499bcc493f

See more details on using hashes here.

File details

Details for the file mermaid_ascii-1.2.0-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-1.2.0-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 95e8636c83468d8ff198f64ffe45c8747390906cac09040c6b88f6d50c8a26bc
MD5 a01e405c6c33cda198ae43c37ca59744
BLAKE2b-256 fd902813cd484bb4685a89c1a785e2e711855eb2e4bbbc8843f32b3938dbf2cc

See more details on using hashes here.

File details

Details for the file mermaid_ascii-1.2.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-1.2.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 9910c2126e546e1d284dfbe1e0004898c0b3b8180b05a1ee5bd2b4625e38455a
MD5 04601ad0a8d3fe9ec41def1fb4caf32c
BLAKE2b-256 c4db3464a53d96dd562d044b20093e250a8b07bf2da2978d2e25c335aa3ccfaf

See more details on using hashes here.

File details

Details for the file mermaid_ascii-1.2.0-cp310-cp310-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-1.2.0-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 fae27d088909e7087fbfdc35031aec9518208e679caa3ce9d18c0235d098b660
MD5 9fa7e8d0c9ec4b7274dc49cd6e39126a
BLAKE2b-256 883653c1e830837e1da0ae6977669bc21001643989e69fd5bb022cc145f04c76

See more details on using hashes here.

File details

Details for the file mermaid_ascii-1.2.0-cp310-cp310-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-1.2.0-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 b5b39f7f11829f8421966901383b27148eca3c32b71d8ad041d696e3cfb79b16
MD5 642ebced4a3641017860793d548f49d6
BLAKE2b-256 c5d4a778c5bc7342dd112384021155c2911c5771dc2981770fc384eb5ff89b2c

See more details on using hashes here.

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