Skip to main content

nimaid

Mermaid diagrams to PNG, GIF, SVG or raw pixels — from Python, with no dependencies. No browser, no Node.js, no Cairo, no system fonts. The renderer is nimaid (pure Nim), shipped as a small native library inside the wheel. DejaVu Sans is built in, so it works the moment it is installed.

pip install nimaid              # add colour emoji:  pip install "nimaid[emoji]"
import nimaid

png = nimaid.png("flowchart LR\n  A[Hello] --> B[World]")          # bytes
open("hello.png", "wb").write(png)

svg = nimaid.svg("sequenceDiagram\n  Alice->>Bob: Hi", theme="dark")   # str (outlined glyphs: looks identical everywhere)
nimaid.render_file("gantt\n title Plan\n dateFormat YYYY-MM-DD\n section A\n T :a, 2025-01-01, 5d", "plan.svg")

Supported: flowchart/graph, sequenceDiagram, stateDiagram(-v2), erDiagram, classDiagram, gantt, gitGraph, mindmap, pie, xychart-beta, timeline, quadrantChart, journey, packet, kanban, radar-beta, treemap-beta, sankey-beta (syntax reference).

API

nimaid.png(text, *, scale=2.0, theme=None, colors=0) PNG bytes. colors=2..256 → smaller palette PNG
nimaid.gif(text, *, scale=2.0, theme=None, colors=0) GIF bytes
nimaid.svg(text, *, theme=None, live_text=False) SVG str (live_text=True keeps selectable <text>)
nimaid.rgba(text, *, scale=2.0, theme=None) Image(width, height, data) straight-alpha RGBA8; .to_pil() if Pillow is installed
nimaid.render_file(text, path, **opts) writes .png / .gif / .svg by extension
nimaid.encode_png / encode_gif(pixels, w, h, colors=0) encode pixels you already have
nimaid.Context(font=None, emoji="auto") reusable context with your own fonts (see below)
nimaid.Diagram(text, theme=None) shows itself in Jupyter; .png() .svg() .save(path)
nimaid.detect_type(text), nimaid.themes() "flowchart" … / ['default','dark','forest','neutral','base']

Themes: default dark forest neutral base, or per diagram with %%{init: {'theme':'base','themeVariables':{'primaryColor':'#ffe08a'}}}%%.

Errors

Everything derives from nimaid.NimaidError: ParseError and UnsupportedDiagramError (both also ValueError; the message says what and where), FontError, InvalidArgumentError (ValueError), RenderIOError (OSError), InternalError.

try:
    nimaid.png("flowchart LR\n A --> ")
except nimaid.ParseError as e:
    print(e)          # Parse error: expecting node id, got tEof

Fonts and emoji

ctx = nimaid.Context(font="MyFont.ttf")           # TrueType (glyf) path or bytes; default is the embedded DejaVu Sans
ctx.png(text)
ctx = nimaid.Context(emoji="NotoColorEmoji-Regular.ttf")   # or emoji=False to switch emoji off

pip install "nimaid[emoji]" installs nimaid-noto-emoji (Noto Color Emoji, OFL-1.1). With the default emoji="auto" it is used automatically — loaded lazily the first time a diagram contains emoji. Reuse one Context for many renders: fonts are parsed once.

Notebooks

nimaid.Diagram("flowchart LR\n A --> B", theme="forest")     # as the last expression of a cell: shows the SVG

Command line

nimaid --theme=dark --scale=3 diagram.mmd diagram.png        # also: python -m nimaid …;  nimaid --help

Notes

  • Thread-safe, not parallel: calls are serialised by a lock inside the library; use processes for parallel throughput.
  • Deterministic: same input → byte-identical output (identical to the native nimaid CLI).
  • Wheels are provided for Linux (glibc ≥ 2.17 and musl; x86_64, aarch64, armv7, i686), macOS 11+ (Intel, Apple Silicon) and Windows (x64, ARM64, x86). Any Python ≥ 3.8 (the library is loaded with ctypes, so there is no per-Python-version build).
  • Set NIMAID_LIB=/path/to/libnimaid.so to use another build of the native library.

License

MIT. The native library embeds DejaVu Sans (DejaVu Fonts License, permits embedding/redistribution); nimaid-noto-emoji ships Noto Color Emoji (SIL OFL 1.1). See THIRD_PARTY.md in the wheel's .dist-info. Source and C API: https://github.com/ghazalialshafi/nimaid.

Metadata

Release files for nimaid 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for nimaid 0.6.0
File Actions
nimaid-0.6.0-py3-none-win_arm64.whl Python 3 none Windows ARM64 Details for nimaid-0.6.0-py3-none-win_arm64.whl
nimaid-0.6.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for nimaid-0.6.0-py3-none-win_amd64.whl
nimaid-0.6.0-py3-none-win32.whl Python 3 none Windows x86-32 Details for nimaid-0.6.0-py3-none-win32.whl
nimaid-0.6.0-py3-none-musllinux_1_2_x86_64.whl Python 3 none Linux musl 1.2+ x86-64 Details for nimaid-0.6.0-py3-none-musllinux_1_2_x86_64.whl
nimaid-0.6.0-py3-none-musllinux_1_2_armv7l.whl Python 3 none Linux musl 1.2+ ARMv7l Details for nimaid-0.6.0-py3-none-musllinux_1_2_armv7l.whl
nimaid-0.6.0-py3-none-musllinux_1_2_aarch64.whl Python 3 none Linux musl 1.2+ ARM64 Details for nimaid-0.6.0-py3-none-musllinux_1_2_aarch64.whl
nimaid-0.6.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for nimaid-0.6.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
nimaid-0.6.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl Python 3 none Linux glibc 2.17+ x86-32 Details for nimaid-0.6.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
nimaid-0.6.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl Python 3 none Linux glibc 2.17+ ARMv7l Details for nimaid-0.6.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
nimaid-0.6.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for nimaid-0.6.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
nimaid-0.6.0-py3-none-macosx_11_0_x86_64.whl Python 3 none macOS 11.0+ x86-64 Details for nimaid-0.6.0-py3-none-macosx_11_0_x86_64.whl
nimaid-0.6.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for nimaid-0.6.0-py3-none-macosx_11_0_arm64.whl

Total release size: 13.1 MB

Release files / nimaid-0.6.0-py3-none-win_arm64.whl

Download URL nimaid-0.6.0-py3-none-win_arm64.whl
Size 1.0 MB
Tags Python 3 Windows ARM64
SHA-256 checksum
How to use checksums
b1f0be302cdae58580d2ddf47ae6ef2b1c276a0e681642b27a8d0fc18c028d7e
BLAKE2b-256 checksum
How to use checksums
9aa7871f939b68f19289e13fa18fef9f68a4a9ca23c354f9cfd15d5595338e53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / nimaid-0.6.0-py3-none-win_amd64.whl

Download URL nimaid-0.6.0-py3-none-win_amd64.whl
Size 1.2 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
a61f6292a42d1ed00217d02004d077df910f1f3053478dd681286e4e5afe544e
BLAKE2b-256 checksum
How to use checksums
49e5e93bf2c28e8a248f9af788419cf1378eb021d8ea0f4a51045ac301732bdf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / nimaid-0.6.0-py3-none-win32.whl

Download URL nimaid-0.6.0-py3-none-win32.whl
Size 1.1 MB
Tags Python 3 Windows x86-32
SHA-256 checksum
How to use checksums
a737ec102a9e804fd055849f47edc22996acf55dbc40d3e78f174d657b712264
BLAKE2b-256 checksum
How to use checksums
5caf38cbd88932b30324299d64fd6830382c3de846ee0519e021a5c2fc785329
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / nimaid-0.6.0-py3-none-musllinux_1_2_x86_64.whl

Download URL nimaid-0.6.0-py3-none-musllinux_1_2_x86_64.whl
Size 1.1 MB
Tags Linux musl 1.2+ x86-64 Python 3
SHA-256 checksum
How to use checksums
f07ff853757d920fe44b208d3ce0de3d2a9245042eb568fa1aef7b5d96aeb03f
BLAKE2b-256 checksum
How to use checksums
3589d2bbd91f183f3bbb779f2db3875d4cef5fdfad2b1aae7bbe71adeaae72d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / nimaid-0.6.0-py3-none-musllinux_1_2_armv7l.whl

Download URL nimaid-0.6.0-py3-none-musllinux_1_2_armv7l.whl
Size 1.1 MB
Tags Linux musl 1.2+ ARMv7l Python 3
SHA-256 checksum
How to use checksums
fc4b8a1b379bb42bccfc4f4a176ec8d489d54988cbdaacd3a7a7fca85265c542
BLAKE2b-256 checksum
How to use checksums
360139690ff2b8e9a1abeeaf02bb6f011e090d8d9c51ebd2947aba35a8970e7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / nimaid-0.6.0-py3-none-musllinux_1_2_aarch64.whl

Download URL nimaid-0.6.0-py3-none-musllinux_1_2_aarch64.whl
Size 1.0 MB
Tags Linux musl 1.2+ ARM64 Python 3
SHA-256 checksum
How to use checksums
45d69d023608eeede8ca55f12b4632724971ff6861e990bf89d03a942a57abe2
BLAKE2b-256 checksum
How to use checksums
e043265d4972d32174f29628aa9a019b2b1f151ebbcd688c1b2a9d4d89fd2ba4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / nimaid-0.6.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL nimaid-0.6.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.1 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
213b7f133ae6fc5f127170c267f565bad3110d27f33d9f4cd50342201da6a465
BLAKE2b-256 checksum
How to use checksums
46ad31ad433cc16314db039fca5a32ba3392b98a203a1e66544f05144d4f9ca4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / nimaid-0.6.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl

Download URL nimaid-0.6.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Size 1.1 MB
Tags Linux glibc 2.17+ x86-32 Python 3
SHA-256 checksum
How to use checksums
ffb7beb422be75a58c2a9bcafa0314f9251be4c3e4b19e4b095daeda36d203e3
BLAKE2b-256 checksum
How to use checksums
0e23ac113df1062f9e9f1438ab8ae80fe402dda462a76c2dd4efa4ce4cf678ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / nimaid-0.6.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl

Download URL nimaid-0.6.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Size 1.1 MB
Tags Linux glibc 2.17+ ARMv7l Python 3
SHA-256 checksum
How to use checksums
4df25c15ea8bc05a67765f9b67574f3f184e4bd505af41e056c3e0b3e0e21567
BLAKE2b-256 checksum
How to use checksums
e01029e4d3997f046514bc645169a81dd0d33d2a563911d6af89af448a8f6202
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / nimaid-0.6.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL nimaid-0.6.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.0 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
f483b2f1840ee03fecba37804e066ffddd972f65decde5c7a7c214992e32ad17
BLAKE2b-256 checksum
How to use checksums
185b2d37b3dbeb7357702103de26dbb4336a1e4bc8931a0533cf7e4dc0909b81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / nimaid-0.6.0-py3-none-macosx_11_0_x86_64.whl

Download URL nimaid-0.6.0-py3-none-macosx_11_0_x86_64.whl
Size 1.1 MB
Tags Python 3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
d858e1de60e929ed3ca547ebbc6af26cbc652f67c7a57e8c0af2cf463051cfb4
BLAKE2b-256 checksum
How to use checksums
aaf01b6e08f927138b0e0adfe139389f5d8af39b90258220133ea4819405c376
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / nimaid-0.6.0-py3-none-macosx_11_0_arm64.whl

Download URL nimaid-0.6.0-py3-none-macosx_11_0_arm64.whl
Size 1.1 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
7fce2d4d4d975337f8900d57dd9491a07651d297c4e7f261ec7350bf29fda0ba
BLAKE2b-256 checksum
How to use checksums
c20fd2d6680f8e80b1e8dde4c9024baa39afbfc561f8bf33273f772a588c5558
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Security for nimaid 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 12 files in this release have been uploaded with provenance metadata.

Select from 12 files

Attestation for nimaid-0.6.0-py3-none-win_arm64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.6.0 This release

12 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page