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-0.6.1.post1-cp313-cp313-win_amd64.whl (19.2 MB view details)

Uploaded CPython 3.13Windows x86-64

mermaid_ascii-0.6.1.post1-cp313-cp313-manylinux_2_39_x86_64.whl (10.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ x86-64

mermaid_ascii-0.6.1.post1-cp313-cp313-macosx_14_0_arm64.whl (9.3 MB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

mermaid_ascii-0.6.1.post1-cp312-cp312-win_amd64.whl (19.2 MB view details)

Uploaded CPython 3.12Windows x86-64

mermaid_ascii-0.6.1.post1-cp312-cp312-manylinux_2_39_x86_64.whl (10.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

mermaid_ascii-0.6.1.post1-cp312-cp312-macosx_14_0_arm64.whl (9.3 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

mermaid_ascii-0.6.1.post1-cp311-cp311-win_amd64.whl (19.2 MB view details)

Uploaded CPython 3.11Windows x86-64

mermaid_ascii-0.6.1.post1-cp311-cp311-manylinux_2_39_x86_64.whl (10.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ x86-64

mermaid_ascii-0.6.1.post1-cp311-cp311-macosx_14_0_arm64.whl (9.3 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

mermaid_ascii-0.6.1.post1-cp310-cp310-win_amd64.whl (19.2 MB view details)

Uploaded CPython 3.10Windows x86-64

mermaid_ascii-0.6.1.post1-cp310-cp310-manylinux_2_39_x86_64.whl (10.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.39+ x86-64

mermaid_ascii-0.6.1.post1-cp310-cp310-macosx_14_0_arm64.whl (9.3 MB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

mermaid_ascii-0.6.1.post1-cp39-cp39-win_amd64.whl (19.2 MB view details)

Uploaded CPython 3.9Windows x86-64

mermaid_ascii-0.6.1.post1-cp39-cp39-manylinux_2_39_x86_64.whl (10.0 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.39+ x86-64

mermaid_ascii-0.6.1.post1-cp39-cp39-macosx_14_0_arm64.whl (9.3 MB view details)

Uploaded CPython 3.9macOS 14.0+ ARM64

File details

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

File metadata

File hashes

Hashes for mermaid_ascii-0.6.1.post1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 d7c00cf94f1ab47255ae851f0f2d88d37aa528fd1860db4492969509df90abf2
MD5 76501f0137c8a8bf050f7c165a5ed3f4
BLAKE2b-256 0a6b789b3b70e8a41a04c0d62f366e7eff61539280ffd24c4025a02e091e3ebb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mermaid_ascii-0.6.1.post1-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 fcc2d6fb0154e437c9e31acbb434ca5c69302990d586538baf21ac4cb80bf76b
MD5 de9a0ce67400adf6469238e2b0b15ce3
BLAKE2b-256 764530eb90925d8dfc0994367448e01ef624f09168c85bf38a1c37381084c957

See more details on using hashes here.

File details

Details for the file mermaid_ascii-0.6.1.post1-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-0.6.1.post1-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 fa16090206fceb8b59a52815caeb1ba35aa8a6a2393017b0333941595f52541f
MD5 9c274023b17633011a32899dc742d09e
BLAKE2b-256 ac11173eb8f35e2ac47e7d79fb79813a734226146cc9ee58acf31714cc9badf0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mermaid_ascii-0.6.1.post1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c95a28d282276ef156086353b0721114ca7e32506ceb82226d33f341a329610a
MD5 cdbdd47bc265fceb8c3258f4c1a920ee
BLAKE2b-256 5b2391609dd0fb2654eb6d4aaae8eb5cd0554dcf322fa5c0acb205771cc6e6cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mermaid_ascii-0.6.1.post1-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 4fa4e702b1f217ea6a5a1b896045c017dfba5b17798a6ba9f7bc139a97df81ce
MD5 4a3a1e3eaee666f6bb2cad03918f1a0c
BLAKE2b-256 dc96ae01e2a13621470cdf8fd33be49a6edb9fef8e8b1eecfbce0790fcaaf7fb

See more details on using hashes here.

File details

Details for the file mermaid_ascii-0.6.1.post1-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-0.6.1.post1-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 78c2989e902de2a54e2e23536c00ec7f8633ad0f1a435c2ce91b83de18d3d536
MD5 681853a533d2c30569b86bc0956ec173
BLAKE2b-256 3781d56e2d1c132a461a65770b6460889719397f0f4c5e770c725eab72a21f5d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mermaid_ascii-0.6.1.post1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 36ccb64d4229fec33ee4897958f098ffa86b8f8143eb63ed08a5e4d5e89a1491
MD5 91fe5be0e9241a3a711ad9c4cb5320d2
BLAKE2b-256 78611e24f701ea8fde1bf9dacc27d88035f0f760c49e9ed605fa21c2ffec1451

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mermaid_ascii-0.6.1.post1-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 f2a88893cfa303bbe73278ae385dac06e6217d22a83b1d0fb20a65148c86eedc
MD5 95ff8c51eb2a60150f7dbd4034d1d156
BLAKE2b-256 8b37166740daef7215c9098439b4ea2917482a9ebe9f28adbe9bf82dba1e1e9c

See more details on using hashes here.

File details

Details for the file mermaid_ascii-0.6.1.post1-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-0.6.1.post1-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 9f3febb401df91742e8a5db7de6cf367ebd05ed6c9d9a011aefce6cd47a9f668
MD5 fdfa17fad53609a03d4d74e1ddaa38c1
BLAKE2b-256 a860e1a8f028eb794073c51523dac1fdc5fb86146e7011e1684740b7ed1f5443

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mermaid_ascii-0.6.1.post1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b93a16bce56bbd39479b58c6a2d17748c9e1c230f4a236b4bc4efc47bfb943b9
MD5 cb854a57874c774d47d755a01c023f7d
BLAKE2b-256 1e508240a1642a0c720a35b9699c9c32961e2efe725c1bad8f333ffecff2b304

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mermaid_ascii-0.6.1.post1-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 bac2297c0aac92536fd6b9eec651b044059873c351e2b04fa621d6b14ecff8da
MD5 e1eb55c128a559c658c71918afdc08c5
BLAKE2b-256 19dc2449c3f228eb15a1ed534ee501ba6a0127bae80e4cee19e41193cb728526

See more details on using hashes here.

File details

Details for the file mermaid_ascii-0.6.1.post1-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-0.6.1.post1-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 8eed7e6b827585b0bf2e4d18f9bba705808fc643e60b81f8eb603f0363423ae8
MD5 669ec6277aa5c7a86b0be3e3822036f2
BLAKE2b-256 a450687f88a43e15e23741bb077db41bc42b527aca8fb0edf7cd114263dc6ead

See more details on using hashes here.

File details

Details for the file mermaid_ascii-0.6.1.post1-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-0.6.1.post1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 ae22b0ca0f2ba9270411768d01956ccf11dacbb77e541f1b45c2c398f3de69e3
MD5 cef03b1d049caf9c0ef7dddccdc5103d
BLAKE2b-256 cd8aa99f11b8ab53199a7a42a03201b91c24c848a4460e62e2591209d0c2888e

See more details on using hashes here.

File details

Details for the file mermaid_ascii-0.6.1.post1-cp39-cp39-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-0.6.1.post1-cp39-cp39-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 f6b44367b14c8d8091e04c16482f2d7c7a8c61bd24f8566d1c1bede586c96595
MD5 b6d49cb60ad29eb9cc166ea7b2b78fa5
BLAKE2b-256 d240c3e5583e54c01196e72643806058a100f58ce9f16c8f71bc7fa221e1cc75

See more details on using hashes here.

File details

Details for the file mermaid_ascii-0.6.1.post1-cp39-cp39-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-0.6.1.post1-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 1fcd61bb90a472c6e91471a6ae373bb09390e75200f3d833968bbe1e4547db4d
MD5 94047ee97a70601bfebdbd0bfb9ec8c6
BLAKE2b-256 be56588c0427678c75df46e052a47dc8bce7ea9036d3fa479f08e1a74992e91a

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