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.1.0.post1-cp314-cp314-win_amd64.whl (19.5 MB view details)

Uploaded CPython 3.14Windows x86-64

mermaid_ascii-1.1.0.post1-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.1.0.post1-cp314-cp314-macosx_15_0_arm64.whl (9.5 MB view details)

Uploaded CPython 3.14macOS 15.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

mermaid_ascii-1.1.0.post1-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.1.0.post1-cp313-cp313-macosx_15_0_arm64.whl (9.5 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

mermaid_ascii-1.1.0.post1-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.1.0.post1-cp312-cp312-macosx_15_0_arm64.whl (9.5 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

mermaid_ascii-1.1.0.post1-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.1.0.post1-cp311-cp311-macosx_15_0_arm64.whl (9.5 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

mermaid_ascii-1.1.0.post1-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.1.0.post1-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.1.0.post1-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-1.1.0.post1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 0e182d172f3dd71e9aa45f50d7e10cdfc02aef494e3809501a50b6db1fc83836
MD5 1381f05ba6a1b5c6975efb9a00f9fb4e
BLAKE2b-256 4d5c75fb9570b4a11867ec796c907f0e5a869b025347bea6424e0ba50c872a28

See more details on using hashes here.

File details

Details for the file mermaid_ascii-1.1.0.post1-cp314-cp314-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-1.1.0.post1-cp314-cp314-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 646350a6f482cf000cd203d54d48b0e726b98e233606ddaccff11dd12a8d36e2
MD5 211ededb9893bc81af1b9627767fe1c6
BLAKE2b-256 7808ebeb027b4acfbd3fe97b7d007ff5c233a25fb041ca755f20d4f316fc69e6

See more details on using hashes here.

File details

Details for the file mermaid_ascii-1.1.0.post1-cp314-cp314-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-1.1.0.post1-cp314-cp314-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 6ba700d486bf582771e58988ef4fe81f8ae84099e3be0ea536590718eab7015a
MD5 7fd68a255dbd6a17c044d18ebcd7799f
BLAKE2b-256 929adf9ed433debf9c799a7b656bc50880e10cc8e1365c8aff0abf0122b7a232

See more details on using hashes here.

File details

Details for the file mermaid_ascii-1.1.0.post1-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-1.1.0.post1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 82e4a3579a6b0fee83d7d3998fb4091d89d5a11ebfd19ad7c5477b21910276bd
MD5 943366f42f3ec37a60ae7e8dd3bd0d90
BLAKE2b-256 a799a1845ecd62c191846a39d6f8df512520841dad8093abe54663183c9fdc6f

See more details on using hashes here.

File details

Details for the file mermaid_ascii-1.1.0.post1-cp313-cp313-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-1.1.0.post1-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 e2361119930c75bfeb56b8bd22a512250e0043bdec98f112f876d98d70e6709b
MD5 cc86a612ad6ae53e5fc6179f1d9669a3
BLAKE2b-256 b54ed21946bc671a758881832f4769dd87bb85382f6f84cb26fc0bee2e71b00a

See more details on using hashes here.

File details

Details for the file mermaid_ascii-1.1.0.post1-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-1.1.0.post1-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 c47e453385e52d238c17e45adb0acf73d753f4ac0635a0bcebc2c6107e9b0a53
MD5 5002dbc857ff3bb9384a752dd9ad348c
BLAKE2b-256 cf2a3ee0cc861022a901ddf4a08d0059fd28213a6e3341ef07acdfb9b491d029

See more details on using hashes here.

File details

Details for the file mermaid_ascii-1.1.0.post1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-1.1.0.post1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 0e2d7b5befe655fa2ce717253b12ef335e9a35cc641c65c0736632f27ad1e7b1
MD5 8386a2a779182f759226123d3fde3b5a
BLAKE2b-256 acb6b0c06b3305048204af25fd338dd3fcaa5d7a4b82ff39dc8bc9bfff647338

See more details on using hashes here.

File details

Details for the file mermaid_ascii-1.1.0.post1-cp312-cp312-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-1.1.0.post1-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 0e820c9f9b55151df2c9b41901234013120013275af6ff81e0f4aba3581ae4a1
MD5 f549bc0be3c303aed71102c92e50b5ed
BLAKE2b-256 f782573e40c1238f7e6ba0d2f087b4cb12184aaa1a800fe2fcc3b6a1eae24f6d

See more details on using hashes here.

File details

Details for the file mermaid_ascii-1.1.0.post1-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-1.1.0.post1-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 ece819c25b10834c4c2bf531cfad6cbee274b2ed79f55f5d6bd57253bdb84218
MD5 ee23efc8e4b5f488605535231e112ed1
BLAKE2b-256 3a7ed0e8111e217d46a9e4d6ed6a6df4739ebd07f0cc4f9361c7578be2296892

See more details on using hashes here.

File details

Details for the file mermaid_ascii-1.1.0.post1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-1.1.0.post1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 22201c3a2a5b54aecd33865ee62994a22137e2e56b546ed3ead87f9adfbe55fa
MD5 3022a1092a78a19d893885b6f4907b3f
BLAKE2b-256 26b8ab0169885317ecedac36002a5ae2b4053b54808035c5a0a320f699c93f0f

See more details on using hashes here.

File details

Details for the file mermaid_ascii-1.1.0.post1-cp311-cp311-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-1.1.0.post1-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 42f097ee9be17066e47d120678c87ef73b574d2929e64d85692305e692f46999
MD5 9adec2a8d253f3624e6486b7e51f8da3
BLAKE2b-256 4e25b3fd61c0017afb25dec0ec7ca1e1088b0f4d275a243cf3370804c9ecba54

See more details on using hashes here.

File details

Details for the file mermaid_ascii-1.1.0.post1-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-1.1.0.post1-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 fdd4178a3647ba9b463e258cb04f6a92746bc78bea0ab9b9a1b413dc26a0f271
MD5 a1364cb9d36d2c1617602a4b433619ec
BLAKE2b-256 9034630781ad3adb5668dbac3d9e5da2eed91d5ba16d4a20e1f7c939d67b8e7b

See more details on using hashes here.

File details

Details for the file mermaid_ascii-1.1.0.post1-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-1.1.0.post1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 600cb1b92a97445e7b33665778d72371f021513796f6fa6938e820b448205899
MD5 ee2d80ee8de5e650ef325bb1ba6f0181
BLAKE2b-256 f3ab1ea3d245544e744fc053eadcf2cc2c1a2870556aa36aa193a8ce3a91645e

See more details on using hashes here.

File details

Details for the file mermaid_ascii-1.1.0.post1-cp310-cp310-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-1.1.0.post1-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 1003ad2afb18dec4d2fd8c57d6392dc48790ca073ced42c212f6f5873c02aa19
MD5 28f927bbe1decb2d9086ec11f54c4f56
BLAKE2b-256 79c915543b0d1cd9de583c195bcc52c62ebbd0fd0b28ccea2a696ab31751c306

See more details on using hashes here.

File details

Details for the file mermaid_ascii-1.1.0.post1-cp310-cp310-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-1.1.0.post1-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 968b546e7406d6e5ce5d0e39aa94f1434f1ba722dc20a671e8c5b80c4c744a55
MD5 8d36d841a77407d8938ac33f117dab08
BLAKE2b-256 f851da157f4e5cb4c53fd2c919b2b768fc656f81670317092a356d37717c076f

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