diagrams
Diagram as Code
Decision gist · record as of 2026-08-14
Yes. Diagrams is actively maintained, permissively licensed, has low install friction, and fills a clear need for developers who want to treat architecture diagrams as code. The 42508 repository stars and top-5000 PyPI position confirm real adoption. The only prerequisite is a separate Graphviz installation, which is a one-time setup. Install it if you need to document or prototype cloud architectures programmatically.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Graphviz to be installed separately on your system (e.g., `brew install graphviz` on macOS, or download from graphviz.org).
- Python 3.9 or higher required.
- Low friction: pure Python wheel with four runtime dependencies (graphviz, jinja2, typed-ast, pre-commit).
License · maintenance · safety
MIT (permissive) — MIT license (permissive) means you can use, modify, and distribute diagrams freely in commercial or private projects with minimal restrictions.
last release 2025-11-22 (265 days) · last repo commit 2026-08-14 · 42,508 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 7,503,612 downloads/mo, #1,733 on PyPI
Alternatives
Verify before relying
pip install diagrams
from diagrams import Diagram
from diagrams.aws.compute import EC2
with Diagram("My Architecture"):
EC2("web")- Whether typed-ast and pre-commit are truly runtime dependencies or development-only (they appear unusual in a diagram rendering library's runtime chain).
- Performance characteristics when rendering large or complex architectures with many nodes and connections.
What it is and what it does
Diagrams is a Python library for creating cloud architecture diagrams as code rather than using graphical design tools. It supports major cloud providers (AWS, Azure, GCP, Kubernetes, Alibaba Cloud, Oracle Cloud) as well as on-premises nodes, SaaS, and programming frameworks. The library uses Graphviz to render diagrams to image files, allowing you to version-control architecture documentation alongside your infrastructure code.
The package is designed for prototyping new architectures, documenting existing systems, and tracking architecture changes through version control. It does not provision cloud resources or generate infrastructure-as-code templates (Terraform, CloudFormation); it is purely for visualization. It requires Python 3.9+ and a system installation of Graphviz.
Use it for
- Document cloud architecture designs in version-controlled Python code for team collaboration and change tracking.
- Prototype new system architectures quickly without opening a design tool, iterating on topology in code.
- Generate architecture diagrams programmatically from infrastructure metadata or configuration files.
- Create consistent, reproducible architecture visualizations for documentation and presentations.
- Visualize multi-cloud or hybrid on-premises deployments with a unified diagram format.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Diagrams is actively maintained, permissively licensed, has low install friction, and fills a clear need for developers who want to treat architecture diagrams as code. The 42508 repository stars and top-5000 PyPI position confirm real adoption. The only prerequisite is a separate Graphviz installation, which is a one-time setup. Install it if you need to document or prototype cloud architectures programmatically.
Install
diagrams on PyPI
Before you install
Low friction: pure Python wheel with four runtime dependencies (graphviz, jinja2, typed-ast, pre-commit). Actively maintained with recent releases; last commit 2026-08-14 and 42508 repository stars indicate stable, well-used project.
Requires Graphviz to be installed separately on your system (e.g., `brew install graphviz` on macOS, or download from graphviz.org). Python 3.9 or higher required.
License in practice
MIT license (permissive) means you can use, modify, and distribute diagrams freely in commercial or private projects with minimal restrictions.
Quickstart
pip install diagrams
from diagrams import Diagram
from diagrams.aws.compute import EC2
with Diagram("My Architecture"):
EC2("web")
Verify before relying
- Whether typed-ast and pre-commit are truly runtime dependencies or development-only (they appear unusual in a diagram rendering library's runtime chain).
- Performance characteristics when rendering large or complex architectures with many nodes and connections.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release ~=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 4 packagesgraphvizjinja2typed-astpre-commit |
| Maintenance | Actively maintained 265 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 7,503,612 / month, #1,733 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9 |
Evidence: diagrams-0.25.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “cloud architecture diagram as code”
- diagramsDiagrams lets you draw cloud system architecture diagrams…
- pystructurizrPyStructurizr provides a Python DSL for defining C4 software…
- plantumlGenerates UML diagrams from text markup by communicating with a…
Give your agent the search over MCP, or paste the wish link into any chat.
More Graphics packages
Pillow adds image processing capabilities to Python, providing file format support, efficient pixel data handling, and image manipulation operations.
Install it if you need to work with images in Python—it is the de facto standard for this task.
fonttools manipulates font files in multiple formats (TrueType, OpenType, AFM, Type 1, Mac-specific) and includes TTX, a tool to convert fonts to and from XML text format.
Install it if you need to read, write, or manipulate fonts programmatically or via the TTX command-line tool.
Enables matplotlib figures to display inline directly within Jupyter notebooks and IPython environments instead of in separate windows.
PyMuPDF extracts, renders, converts, and manipulates PDF and other document formats (XPS, EPUB, images, Office files via Pro) with high performance, providing text, tables, images, and metadata with precise layout information.
The AGPL license requires careful review if you are building proprietary software—commercial licensing is available from Artifex.
pypdfium2 is a Python binding to PDFium that enables PDF rendering, inspection, manipulation, and creation through a ctypes interface to Google's PDFium library.
Install it if you need PDF rendering, inspection, or manipulation in Python; the medium install friction is offset by comprehensive platform support.
Altair is a declarative Python library for creating interactive statistical visualizations by writing simple, readable code that compiles to Vega-Lite specifications.
See also pystructurizr · seedir · cloudbridge · pulumi · torchviz · graphviz · matplotlib-venn · schemdraw · django-diagram · pulumi-gcp