umeko-drawio
Offline export of draw.io diagrams as SVG, PNG, JPEG or PDF. Install from PyPI or an approved mirror. The distribution includes the JavaScript renderer and uses PyPI dependencies to execute it and encode images. Rendering requires no network access.
Command line and Python
python -m pip install umeko-drawio
umeko-drawio input.drawio -o output.svg
umeko-drawio input.drawio -o output.png --scale 2 --font-family "Noto Sans CJK SC"
umeko-drawio input.drawio -o output.pdf --page 1
from pathlib import Path
from umeko_drawio import render
result = render(Path("input.drawio").read_text(encoding="utf-8"), "png", scale=2)
Path("output.png").write_bytes(result.data)
for warning in result.warnings:
print(warning)
Each export renders one page. The default is the first page. Pass a zero-based
index, a page ID or a name with --page or page=. PNG and SVG can retain
transparency. JPEG and PDF use a white backing where the diagram is transparent.
PDF is a single raster page.
For Chinese labels, install a suitable font in the rendering environment or use
--font-file or font_files=. The CLI and server also accept
DRAWIO_EXPORT_FONT_FILES (paths separated by the platform's path separator)
and DRAWIO_EXPORT_FONT_FAMILY. Fonts are provided by the deployment.
HTTP export
The server extra provides an HTTP interface for offline exports.
python -m pip install 'umeko-drawio[server]'
drawio-web --host 127.0.0.1 --port 8001
curl http://127.0.0.1:8001/ --data-urlencode xml@input.drawio -d format=svg -o output.svg
The service accepts form-encoded requests at POST / and exposes GET /health.
Export options include format, scale, border, page and background.
Responses contain the export bytes and their media type, with
X-Drawio-Warning-Count when applicable.
Interactive web nodes
Install the server extra and start the package with a SQLite file and the external service URL. The wheel includes the official draw.io Web editor.
python -m pip install 'umeko-drawio[server]'
drawio-web --node-db nodes.sqlite3 --public-url http://127.0.0.1:8001
curl -X POST http://127.0.0.1:8001/api/nodes \
-H 'Content-Type: application/json' -d '{"title":"Example"}'
Open the returned url to edit and download the diagram. Pass xml with the
initial draw.io XML when creating a node. Use GET /api/nodes/{id}/xml to read
it and PUT /api/nodes/{id}/xml with the new XML to update it. The editor
autosaves and uses ETag and If-Match so an older page cannot overwrite a newer
revision. After an API update, reload any open editor to see the new revision.
Each node link grants read and write access to its diagram. Keep the service on a private network or behind your application's access control, and treat node links as credentials. Each browser saves its own edits with a revision check. Reload to see changes saved in another browser.
For a deployment prefix, include it in --public-url. Forward every child
path to this service after stripping the prefix once. When mounting
create_app(node_db=..., public_url=...) in another ASGI app, mount it under
the path in the public URL.
The editor bundle contains the static browser resources from the official draw.io v32.6.10 release. The build script verifies the pinned release SHA-256 and excludes the Java server files. The editor's Apache-2.0 license ships with the wheel. The package loads these resources from its own host and restricts editor connections to that host.
Renderer provenance and limits
- The bundled JavaScript is the unmodified
dist/index.cjsfrom @dskripchenko/drawio 0.1.0, under MIT. The accompanying copyright and license ship with the wheel. SHA-256 of that file is13d33c42c64a0cb7188702438f2fe3d14eaaf6a52aadfd8474c39297adeb31a4. - quickjs-ng runs the bundled code, resvg-py renders PNG, and Pillow encodes JPEG and raster PDF. These PyPI dependencies include platform-specific native wheels.
- The SVG renderer supports common shapes, orthogonal edges, waypoints, and nested groups. Vendor stencil libraries and rich labels can look different from draw.io Desktop. External images are disabled. The package targets flowchart and architecture exports, and it preserves the original diagram file for editing.
- The input limit is 4 MiB for the source and each expanded page. Each export is capped at 8,192 pixels per side and 16 megapixels total.
Development
python -m pip install -e '.[server]' pytest httpx build twine
python scripts/bundle_editor.py
python -m pytest -q
python -m build
python -m twine check --strict dist/umeko_drawio-0.2.1*
Metadata
Release files for umeko-drawio 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| umeko_drawio-0.2.1.tar.gz | 45.0 MB | With provenance | Details for umeko_drawio-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| umeko_drawio-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for umeko_drawio-0.2.1-py3-none-any.whl |
Total release size: 90.0 MB
Release files / umeko_drawio-0.2.1.tar.gz
| Download URL | umeko_drawio-0.2.1.tar.gz |
|---|---|
| Size | 45.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
965366c8e84406ba6c7fc488ee4a9b850aaef15dbcde6c6a2ce3d8665a4198d5
|
|
BLAKE2b-256 checksum How to use checksums |
6d664faa41e9fe4ef8045629e04937042af3cf8532c913ad1950a9d1c28f9df0
|
| 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 5, 2026.
Transparency logRelease files / umeko_drawio-0.2.1-py3-none-any.whl
| Download URL | umeko_drawio-0.2.1-py3-none-any.whl |
|---|---|
| Size | 45.0 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8a2b63805551545e8c59ba665462304ae3d11e3bb4fc41e6ac1e28a8c2d2f15b
|
|
BLAKE2b-256 checksum How to use checksums |
b4a5f8341f620295ffbc1f601440b032b178bab1a83d5f51f06170451f70a18a
|
| 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 5, 2026.
Transparency logSecurity for umeko-drawio 0.2.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
Both files in this release have been uploaded with provenance metadata.
Attestation for umeko_drawio-0.2.1.tar.gz
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 5, 2026.
Transparency logA 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.