Metadata-Version: 2.4
Name: excalidraw-skill-pack-render
Version: 0.2.0
Summary: Render Excalidraw JSON to PNG. Python binding for excalidraw-skill-pack.
Project-URL: Homepage, https://excalidraw-skill-pack.vercel.app
Project-URL: Repository, https://github.com/isatimur/excalidraw-skill-pack
Project-URL: Documentation, https://excalidraw-skill-pack.vercel.app
Project-URL: Bug Tracker, https://github.com/isatimur/excalidraw-skill-pack/issues
Author: Timur Isachenko
License-Expression: MIT
Keywords: ai-agent,cli,diagrams,excalidraw,playwright,png,render,visualization
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Multimedia :: Graphics
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.11
Requires-Dist: playwright>=1.40.0
Description-Content-Type: text/markdown

# excalidraw-render

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

## Install

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

## Python API

```python
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.

```python
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

```bash
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.
