Skip to main content

Render Excalidraw JSON to PNG. Python binding for excalidraw-skill-pack.

Project description

excalidraw-render

Python binding for rendering Excalidraw JSON to PNG, part of excalidraw-skill-pack.

Install

pip install excalidraw-skill-pack-render
playwright install chromium

Python API

from excalidraw_render import render_to_png

png_bytes = render_to_png(json_str, theme="default-sketchy", scale=2, width=1920)

Batch (reuse one browser)

Launching Chromium is the dominant cost of a render; reuse it across diagrams.

from excalidraw_render import BatchItem, Renderer, render_many

# One-shot batch — launches one browser, renders all, closes it:
pngs = render_many([
    BatchItem(json=json_a, theme="dark", scale=2),
    BatchItem(json=json_b, theme="notion"),
])

# Or drive the browser yourself for long-lived processes / servers:
with Renderer() as renderer:
    png = renderer.render(json_str, theme="default-sketchy", scale=2, width=1920)

render_to_png is a convenience wrapper that launches and closes a browser for a single render — output is identical to Renderer.render.

CLI

excalidraw-render diagram.excalidraw --output diagram.png --scale 2 --width 1920

Parity with Node binding

The Python and Node renderers share packages/shared/render_template.html and produce pixel-equivalent output at matching scale/width settings.

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

excalidraw_skill_pack_render-0.2.0.tar.gz (26.1 kB view details)

Uploaded Source

Built Distribution

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

excalidraw_skill_pack_render-0.2.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file excalidraw_skill_pack_render-0.2.0.tar.gz.

File metadata

  • Download URL: excalidraw_skill_pack_render-0.2.0.tar.gz
  • Upload date:
  • Size: 26.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for excalidraw_skill_pack_render-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b8b2cc136724485078bd3d6d252839d830b81fd9897a538b6658558f17e18299
MD5 ace30582cff788a44e4bed342ec81738
BLAKE2b-256 d3d599a26e6be535dce0fc5777eeced6f2708c1c4d15b48f7172bc43cb84956c

See more details on using hashes here.

File details

Details for the file excalidraw_skill_pack_render-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: excalidraw_skill_pack_render-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for excalidraw_skill_pack_render-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4bf5a67656453b4fad45c12f51f6c8801e9412d3e4612b3bbdd1730ea6a34183
MD5 3243d107e5c99073e1e87842065eca80
BLAKE2b-256 e6c99045f22dc709b7f76696a48587d831c0003f0188d3eb5304adc2c4c3f078

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