Skip to main content

Diagram as Code — with interactive web editor and headless PNG export

Project description

diagrams logo

diagrams-editor

license pypi version python version

Fork of mingrammer/diagramsDiagram as Code with an interactive web editor and headless PNG export included out of the box.

Note: installs under the diagrams Python namespace and replaces the original diagrams package. Do not install both in the same virtualenv.

Install

uv add diagrams-editor

That's it. The web editor, the headless PNG export, and all dependencies come in one command.

Usage

Open the web editor

uv run diagrams editor

Opens http://localhost:8888 in your browser. Drag nodes from the palette, draw edges, group into clusters — the Python code is generated live in the sidebar.

From there you can:

  • 📥 Import .py — load an existing diagrams file for visual editing
  • 💾 Save .py — download the generated Python code (Ctrl+S)
  • ⬇ Export PNG — download a screenshot of the canvas

Export PNG from the command line

Useful for CI pipelines and AI agents — no browser needed.

uv run diagrams export architecture.py architecture.png

One-off, without adding to the project

uv run --with diagrams-editor diagrams editor
uv run --with diagrams-editor diagrams export architecture.py architecture.png

Write diagrams in Python

from diagrams import Diagram, Cluster, Edge
from diagrams.aws.compute import ECS, Lambda
from diagrams.aws.database import RDS
from diagrams.aws.network import ALB

with Diagram("Web Service", direction="LR"):
    with Cluster("App"):
        svc = ECS("Service")
        fn  = Lambda("Worker")
    ALB("Load Balancer") >> svc >> RDS("Database")

Providers

aws azure gcp kubernetes alibaba oracle onprem generic saas

Full node list: diagrams.mingrammer.com/docs/nodes/aws

Examples

The examples/ folder contains ready-to-import .py files:

File Description
examples/web_app.py Three-tier web application
examples/ecommerce_platform.py Full e-commerce platform (34 nodes, 11 clusters)

License

MIT — fork of mingrammer/diagrams, original copyright retained.

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

diagrams_editor-0.28.0.tar.gz (33.3 MB view details)

Uploaded Source

Built Distribution

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

diagrams_editor-0.28.0-py3-none-any.whl (34.6 MB view details)

Uploaded Python 3

File details

Details for the file diagrams_editor-0.28.0.tar.gz.

File metadata

  • Download URL: diagrams_editor-0.28.0.tar.gz
  • Upload date:
  • Size: 33.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.9 {"installer":{"name":"uv","version":"0.11.9","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":null}

File hashes

Hashes for diagrams_editor-0.28.0.tar.gz
Algorithm Hash digest
SHA256 77bccff060f9745bd00db7d093c0b301e82d8f7d7c4d7bf1c1a03baa7e65d81b
MD5 9c81a13e36eb79b708afa57d9ba52a0e
BLAKE2b-256 9a4e943f526fa98b1db79fdf0077b4a8a1177dc770342ce9a0f290415dc920de

See more details on using hashes here.

File details

Details for the file diagrams_editor-0.28.0-py3-none-any.whl.

File metadata

  • Download URL: diagrams_editor-0.28.0-py3-none-any.whl
  • Upload date:
  • Size: 34.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.9 {"installer":{"name":"uv","version":"0.11.9","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":null}

File hashes

Hashes for diagrams_editor-0.28.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fda8710b0f3563be5d695b8939c280f517c323f6673a371cb6f4d4fc8e1485b4
MD5 53185ddb4d60c839aff2510b472921a4
BLAKE2b-256 c0f4ce80b375bd5805bbd7bc59311a65f8590d57770c4409970cc796a3c9c266

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