--- id: diagrams version: "0.25.1" license: MIT license_treatment: permissive maintenance: active --- # diagrams — Diagram as Code License: permissive · Maintenance: active · Downloads: 7.5M/mo ## 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 above — verify before relying. Diagrams lets you draw cloud system architecture diagrams programmatically in Python, supporting major cloud providers like AWS, Azure, GCP, Kubernetes, and on-premises infrastructure. 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 pip install diagrams uv add diagrams poetry add diagrams ## Installing diagrams 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. 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") 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. 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_current - Install friction: low - Maintenance: active - Downloads: 7.5M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags cloud architecture diagram as code, draw system architecture python, visualize cloud infrastructure, aws azure gcp diagram generator, infrastructure diagram python, cloud topology visualization, architecture diagram version control, infrastructure-as-code, cloud-architecture, visualization [View on SkillFed](https://skillfed.io/packages/diagrams) · [View on PyPI](https://pypi.org/project/diagrams/)