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 Distribution

mermaid_ascii-0.7.0.tar.gz (9.9 MB view details)

Uploaded Source

Built Distributions

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

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

Uploaded CPython 3.14Windows x86-64

mermaid_ascii-0.7.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-0.7.0-cp314-cp314-macosx_15_0_arm64.whl (9.5 MB view details)

Uploaded CPython 3.14macOS 15.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

mermaid_ascii-0.7.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-0.7.0-cp313-cp313-macosx_15_0_arm64.whl (9.5 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

mermaid_ascii-0.7.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-0.7.0-cp312-cp312-macosx_15_0_arm64.whl (9.5 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

mermaid_ascii-0.7.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-0.7.0-cp311-cp311-macosx_15_0_arm64.whl (9.5 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

mermaid_ascii-0.7.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-0.7.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-0.7.0.tar.gz.

File metadata

  • Download URL: mermaid_ascii-0.7.0.tar.gz
  • Upload date:
  • Size: 9.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.1 CPython/3.14.3 Linux/6.8.0-51-generic

File hashes

Hashes for mermaid_ascii-0.7.0.tar.gz
Algorithm Hash digest
SHA256 5e03519ca7603a197c197ae0764f66b16a1feb8affb8a150285f288e7f4bc1c3
MD5 c45a07ceac3f6595668943b83686b5e0
BLAKE2b-256 64823ebb71b3910a6fd49f3ba0621b142f1b6e01e9dee32ec5153bf3fb4feb39

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mermaid_ascii-0.7.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 baace6b09d208582696086d84b0f1d2c5b8ee2c73f2dd9644740a7ce1699ac07
MD5 4c0993830ed1a7af678a2b92991d89c4
BLAKE2b-256 9db96924cd2a2a0b9e6a812e973e2a9184106ee5eb9fa301667643fe745be06b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mermaid_ascii-0.7.0-cp314-cp314-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 db7e10958a1816b028fee3c0bef9ad849238c7e7af0b2278390e30be41c97870
MD5 0fd1e739961f4da0f40c946adf0542ba
BLAKE2b-256 25189be21a1144c56a28072fd41f43c7e085f7df0b078def5b99745bbef10057

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mermaid_ascii-0.7.0-cp314-cp314-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 7755947ad3135b7f1cd19b9b9f25ebbd054d7a556271c39020c681a481fbde1c
MD5 0b92857fd76a388f45b07703559c73a0
BLAKE2b-256 c40cfbe54daf41db6891b2c63703981b6f1a444223d4078461519d92b41cfa7d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mermaid_ascii-0.7.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 ccbd2741262adc4411835f81d9efa77535db7bdac29bc9d19ff8624a5c9c3f35
MD5 01123c70cc21bb2637df1869ed0fecfc
BLAKE2b-256 7398a0dbd5960773bb70e556eb246732acef6cc0ab31e6eb075a3a95d0d65ee1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mermaid_ascii-0.7.0-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 73c5e67bc04573fc0f820f1dce70dfbf1163e421e0cb99712701292a14c40f09
MD5 d4e0b5a2ca9a64bf148a98b88c0ba989
BLAKE2b-256 bcf4f74553b2f5707fcd14f6a883452ee1e688af161efde54ac3da242cfd3140

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mermaid_ascii-0.7.0-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 09c059a6118033161513045985e3d2294f362e793efed7bcc6e8f8208d9fe457
MD5 b6af556dfe2575a20437557dacbc7ace
BLAKE2b-256 2c27955982322b417e95a825b77498c2a1d73ff03614798c41fdf2c0e2845658

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mermaid_ascii-0.7.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e8583df09a8776e2cc918c2d9a78916389150da98cd746e17aa06e1c5b5bb610
MD5 5933d32d2771e5bbc68131cb46014353
BLAKE2b-256 ff2300542afdb8e2462f0c9f59f8eb30823c6abfee949dacf5c83b0bfd03224f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mermaid_ascii-0.7.0-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 6784607e183583e863c9d3ba9563a8bd60608ab7cf892ef9ff16a89620bb24c6
MD5 c41a752049a3f66facee54507cf8885e
BLAKE2b-256 860b0a08e6cd884973a42580ea5ca8ab1fdd89b560d184c857ea5a3ed818ec06

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mermaid_ascii-0.7.0-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 48a6352559a6ca3a4da97d326d8065506c26fedee8a61529ebf5d960d9f940a9
MD5 1fbbb2bc12d8f709e5e74fc92ebd69f4
BLAKE2b-256 53abeda1fc63cfd29df868579570ff82c4deaf82ec7ad8ffcb92fb808c2a87e2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mermaid_ascii-0.7.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 39b0cdda2f0e66b71e1ff53410967af3217366e717ecec9a1954ea17b28dd5b1
MD5 a7c2a28c1aba35a1e817d435c5d624f3
BLAKE2b-256 05513ad2958e836c6809c864f7dab518b086c7d2f7a70867c7d80ceef3a26be7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mermaid_ascii-0.7.0-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 d1465584260a6f39dfd53624259e2777b5a0581e6fd9ec03c4211979f5d0a90b
MD5 f66cad407b059d33153ad9216d52c301
BLAKE2b-256 0cac5fcadcc053f9068be725efb91143fd81b6a2d2860aaee0864b48828d1c94

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mermaid_ascii-0.7.0-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 e8074f83c3a403ce01bbf0a2d0f635d999888636c5159c219c667470b4d3a65d
MD5 1ee27d0d1b53e52558c81b8f35c258d4
BLAKE2b-256 858d91d1238de1653bfc34da1a28625094485317912b0b883bf36ddca91e8e5c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mermaid_ascii-0.7.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 1a1762476d77d81b45260ca13483b122252164404398762630c805fc0c01dce4
MD5 c403a8c67ce636b90b3437b256f72f82
BLAKE2b-256 cd06115a05f5090a80c5453b9f9c528b7227beb87cf03dabfc5578107b294516

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mermaid_ascii-0.7.0-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 0955268d1417fe15266b8930a2877d1114c8b6025808573d1910797dc5692014
MD5 c7d241f66b13b98e9dcb8ff4a48c6c54
BLAKE2b-256 57be8d95bd08b4843e5de4f0e2f34a287c7d45578e2958439663a3e2bc1eb301

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mermaid_ascii-0.7.0-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 d1c1ebe474eda01813cc13ee8e5502493a87134aeb70978b2d47a6c818010fdb
MD5 5ce19945198d32476e7568cbad90dc6c
BLAKE2b-256 a1bc0a9ba95d92c5cdc1d4d5e1799b69ed130c3c1e8a15dad262cd6c9cf65a6e

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