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

Uploaded CPython 3.13Windows x86-64

mermaid_ascii-0.6.1.post2-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.post2-cp313-cp313-macosx_15_0_arm64.whl (9.4 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

mermaid_ascii-0.6.1.post2-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.post2-cp312-cp312-macosx_15_0_arm64.whl (9.4 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

mermaid_ascii-0.6.1.post2-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.post2-cp311-cp311-macosx_15_0_arm64.whl (9.4 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

mermaid_ascii-0.6.1.post2-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.post2-cp310-cp310-macosx_15_0_arm64.whl (9.4 MB view details)

Uploaded CPython 3.10macOS 15.0+ ARM64

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

Uploaded CPython 3.9Windows x86-64

mermaid_ascii-0.6.1.post2-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.post2-cp39-cp39-macosx_15_0_arm64.whl (9.4 MB view details)

Uploaded CPython 3.9macOS 15.0+ ARM64

File details

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

File metadata

File hashes

Hashes for mermaid_ascii-0.6.1.post2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 1b1734ed6a8d99eec1e423be8e8c132be1a83e17f6bba82e7b69efba0112a770
MD5 fbdbe63e3b1f2c0cc5d98ff6b7b73832
BLAKE2b-256 bd5dbbb683f5a66f06ab6686146787d5690c526d74f133d613e7beccb26b8d6c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mermaid_ascii-0.6.1.post2-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 ab36730f9d7832f639ce0009f966434a7aabb0fdc600bdc710db954dc91f9fdd
MD5 83f548ce972a0b6e1b9c230c4321492d
BLAKE2b-256 d00867d21eb4a6b4f7e93974cb95ef36dfd548a804adb513162b348646e8ba25

See more details on using hashes here.

File details

Details for the file mermaid_ascii-0.6.1.post2-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-0.6.1.post2-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 fd123b37f68b105b831efe3ddf90ead3ea3edc8267a3acf33799d77b39902adc
MD5 ec5208a689af2c4039ec8152a2fd5949
BLAKE2b-256 e44afd41226e1efe0cc7bf4b602eb45db1ce74caf320f1a817e48e403957ab88

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mermaid_ascii-0.6.1.post2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 497db11bab4878ef83264541625ab37d0dcdaa96753d744071dac6c044143268
MD5 fea60768d6b54b535d930b2358be60c5
BLAKE2b-256 c6072ade606d43665836273a7a4ef81878c6b1702e8ffb645c5867bbd4fbd0bc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mermaid_ascii-0.6.1.post2-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 35e901fca00c7e9d3e77c7040c62ece9540fd39c722faed23b02512dc62df331
MD5 b14f7454d170b4e2c5c37481244551ac
BLAKE2b-256 0922094cf35c9fdf88a29cb03c0a20e39a25f12574688a8b054f3fa53ca007a7

See more details on using hashes here.

File details

Details for the file mermaid_ascii-0.6.1.post2-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-0.6.1.post2-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 2b1870d66e2c528563508aec89b4136eb5da297237b3da30b65439007ce99297
MD5 904a1fd5a455dbaff2c58a86077d8f2f
BLAKE2b-256 06a0ea98094308c0a9be716477246804cc22942996d55a9d4b48f69b2ac3f649

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mermaid_ascii-0.6.1.post2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 58d1a2269647b610367387d55a00a2202d5ee89f49b781566190660ee5581702
MD5 db5e114a1bd5a0cb5bca0999e36015da
BLAKE2b-256 c619d8e5ae400824f919e0f98a0234a43e3ecf6ce2c1f1c3013896b50bfa8756

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mermaid_ascii-0.6.1.post2-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 a9821aeaa927ab7c83f0b8cfdea939c271ad756866c18881614cc6f3c4bcf712
MD5 37339efd27d1083b7b127ddc4c3d694d
BLAKE2b-256 df813914f1dc69fe63bf3a633e19a2170a1a832faff88ae1cb24c635d034a650

See more details on using hashes here.

File details

Details for the file mermaid_ascii-0.6.1.post2-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-0.6.1.post2-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 56d9c244ea467fd22870f9a6b6376e7813aa893dd0bc43ff0555fd23591f93b6
MD5 774c266517a6cd573478cbca63b58382
BLAKE2b-256 21e3bbc4f1e17ba37c4c018453ffcbeae738f8797afeb06ba9080f3ce97858d9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mermaid_ascii-0.6.1.post2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 9ad9af1d3003d090d53ac475b108cef49a621fc3dc35b67770193ba79f53aa23
MD5 b7a038d9461a7fe24b5343462e0027e0
BLAKE2b-256 fee9bb5a0309ba10ac5f2cf3378d1ebfa1b7c216dbfb9d23d41f399547505854

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mermaid_ascii-0.6.1.post2-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 8100713091c543526a7bd8245e1b724209033496c86fab5cabeb324bee872b33
MD5 075f5970353ffb9b434e27c13294ca51
BLAKE2b-256 65594fa490e63463336a9e31ead24b508500aab06219fa161e70251b67d505a3

See more details on using hashes here.

File details

Details for the file mermaid_ascii-0.6.1.post2-cp310-cp310-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-0.6.1.post2-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 19c873ad96b67b4d68058cb4392c59d1731befe4438fa4a67ac3c7669eb17266
MD5 15cb50d99547bb37b8442320a5d9ae5d
BLAKE2b-256 db7322282f8617d3766121e8a7d09b75c5ba3d0bff4b89c2aa788bf24cd0f694

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mermaid_ascii-0.6.1.post2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 a5f433e79db424a57d27d02334080c0e49beb31b534daba580e54c1b7d06467d
MD5 4ca3f78fd2a3a283373e18478f965031
BLAKE2b-256 a3bfafc4d0260c673f8ad68bacc8b09b22dcad36cf2b9bfd0220dc903d4388b7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mermaid_ascii-0.6.1.post2-cp39-cp39-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 8d55c98a80705ce20369e5f7a4155e0af2bf1924f4329b19142f01aae93b9c71
MD5 f8d34a9b297b597d8a9a028b3b2f9c38
BLAKE2b-256 0db57c9b514716244bdf504b4a12ca3c1ef8eb6659ca9d69b03aa252a0f895b2

See more details on using hashes here.

File details

Details for the file mermaid_ascii-0.6.1.post2-cp39-cp39-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for mermaid_ascii-0.6.1.post2-cp39-cp39-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 039d336b77e2deb676a57e4e0d3cf037e68eb933d89612627964a88d96ce2bfb
MD5 1fe7b4b6354943a9fab3f68f64a6a347
BLAKE2b-256 a9463b8abfd2339399892cd71a79a737368590b99cc38a913ebb087d09c1defa

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