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.

Try it in your browser · Website · Source and docs

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.1

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.1
File Actions
nimaid-0.6.1-py3-none-win_arm64.whl Python 3 none Windows ARM64 Details for nimaid-0.6.1-py3-none-win_arm64.whl
nimaid-0.6.1-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for nimaid-0.6.1-py3-none-win_amd64.whl
nimaid-0.6.1-py3-none-win32.whl Python 3 none Windows x86-32 Details for nimaid-0.6.1-py3-none-win32.whl
nimaid-0.6.1-py3-none-musllinux_1_2_x86_64.whl Python 3 none Linux musl 1.2+ x86-64 Details for nimaid-0.6.1-py3-none-musllinux_1_2_x86_64.whl
nimaid-0.6.1-py3-none-musllinux_1_2_armv7l.whl Python 3 none Linux musl 1.2+ ARMv7l Details for nimaid-0.6.1-py3-none-musllinux_1_2_armv7l.whl
nimaid-0.6.1-py3-none-musllinux_1_2_aarch64.whl Python 3 none Linux musl 1.2+ ARM64 Details for nimaid-0.6.1-py3-none-musllinux_1_2_aarch64.whl
nimaid-0.6.1-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.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
nimaid-0.6.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl Python 3 none Linux glibc 2.17+ x86-32 Details for nimaid-0.6.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
nimaid-0.6.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl Python 3 none Linux glibc 2.17+ ARMv7l Details for nimaid-0.6.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
nimaid-0.6.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for nimaid-0.6.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
nimaid-0.6.1-py3-none-macosx_11_0_x86_64.whl Python 3 none macOS 11.0+ x86-64 Details for nimaid-0.6.1-py3-none-macosx_11_0_x86_64.whl
nimaid-0.6.1-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for nimaid-0.6.1-py3-none-macosx_11_0_arm64.whl

Total release size: 13.1 MB

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

Download URL nimaid-0.6.1-py3-none-win_arm64.whl
Size 1.0 MB
Tags Python 3 Windows ARM64
SHA-256 checksum
How to use checksums
868f28106437f564f7224479cb4a33f101d177fffefc449260ff5d38feeb690d
BLAKE2b-256 checksum
How to use checksums
25036b979f942df6e10e170f9b85daee264c62b3ff528180a0b7ad6753d74796
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.1-py3-none-win_amd64.whl

Download URL nimaid-0.6.1-py3-none-win_amd64.whl
Size 1.2 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
d33e70a54da041c52e0c40e730e0bf9fa7a00b90210a2f3937036aeff90577e1
BLAKE2b-256 checksum
How to use checksums
a6f9c194fe53c216a8b835a9cb15d54cb896ee056f1d834a2a74ee02dcad4498
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.1-py3-none-win32.whl

Download URL nimaid-0.6.1-py3-none-win32.whl
Size 1.1 MB
Tags Python 3 Windows x86-32
SHA-256 checksum
How to use checksums
aed144868f379c6d46cd862d33de05c53d7a8b9d878ad7178e8fc7ce7d43d009
BLAKE2b-256 checksum
How to use checksums
bd1475b0e615c4491d622a94a34e1c34895807eca487ba2f8e2482c485241324
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.1-py3-none-musllinux_1_2_x86_64.whl

Download URL nimaid-0.6.1-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
0abbcb20ba48711cb2d25d4cf305e129acfd2740585e1d9611686ec1c31ff4c9
BLAKE2b-256 checksum
How to use checksums
7c6fe94f1932b41eacbd26f70da4c9628150fd909da3db70b7e9b1c98bfa66f9
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.1-py3-none-musllinux_1_2_armv7l.whl

Download URL nimaid-0.6.1-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
47abbadbf35c7d43fc5ee81160a4fc6854e7dfda1ebeb8f1216e7103fe486abc
BLAKE2b-256 checksum
How to use checksums
9a1e9ca07c65350bb9bba46e1e76700e262aa6741f85eb7989d3c0e890ba80d8
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.1-py3-none-musllinux_1_2_aarch64.whl

Download URL nimaid-0.6.1-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
97b0e153416b87f2a8ec426cdb515dd21f69786573594e7345b849a3be740321
BLAKE2b-256 checksum
How to use checksums
0dd53c70f0a1cb4856c994de6deb20bbc3dbc6430d83652e1d670a4e0ce6cae0
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.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL nimaid-0.6.1-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
e24ac828e1c905074d1ab290e4ad0683fa81e527103f7acf4280f75d17c6275b
BLAKE2b-256 checksum
How to use checksums
5de67bbea38caa570f1700875be00f9d2a38eb6762593c530c87518d3869fa62
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.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl

Download URL nimaid-0.6.1-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
1416adea806dd80993242478bcb19ef56ffdfbef66baedc34d94800566b16354
BLAKE2b-256 checksum
How to use checksums
c4f5f97885b4ac628efcad6de323725fabad97c101942a3bc2b47d69faf818a3
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.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl

Download URL nimaid-0.6.1-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
d9d3e87e196b5697f0e514050dcc4e38429afaf7b56fc43e79a190e6237e96ba
BLAKE2b-256 checksum
How to use checksums
5611cfcae997908643cc02276d0603bb10873cdc214550e78f637d501a803123
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.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL nimaid-0.6.1-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
bf6c68317b2ec13c5578b88e167de4d6a0f5efd03e541ae5d0ce905d622bb7b8
BLAKE2b-256 checksum
How to use checksums
0e611d41cc71f1b3004f01ed04b45ad58e21a751a3edf1bdfeaebc548240278d
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.1-py3-none-macosx_11_0_x86_64.whl

Download URL nimaid-0.6.1-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
7af15c01ddbe77a9be6b2284b6e26294b245de0e6e4752a38cf73c6523f812bd
BLAKE2b-256 checksum
How to use checksums
3ea7c148b817e0e3ee944c1e52b3ba77e0f2d79454f6c036c578c7b393215567
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.1-py3-none-macosx_11_0_arm64.whl

Download URL nimaid-0.6.1-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
6d3f954096d786f757b3952f8c0679be15fd9aa500a38e7da8bab34f4f846ed7
BLAKE2b-256 checksum
How to use checksums
12469d7c9fbb1a81756dd53ee19b252e2611fa7566f1dbcf83d23b9ca31ce681
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.1

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.1-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.1 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