packages = ["bokeh", "pandas", "numpy", "networkx", "diagrams", "scikit-learn", "pillow", "matplotlib", "plotly"] [[fetch]] files = ["diagrams_base.py"] from = "../../python/diagrams/" [[fetch]] files = ["pyscript_manager.py", "data.py"] to_folder = "lib" from = "../../python/lib/" [[fetch]] files = ["bokeh_utils.py"] from = "../../python/bokeh/" [[fetch]] files = ["matplotlib_utils.py", "plotly_utils.py"] from = "../../python/matplotlib/" [[fetch]] files = ["agent.py", "trainer.py", "utils.py", "metrics_chart.py", "crossover.py", "__init__.py"] to_folder = "ml/neuro" from = "../../python/ml/neuro/" [[fetch]] files = ["trainer.py"] to_folder = "ml/grokking" from = "../../python/ml/grokking/"

Loading...

🐍 Loading diagrams...

Example 1

Example 2

Example 3

Example 4

Example 5

Diagrams Gallery

πŸ“¦ What is Diagrams?

Diagrams is a Python library that lets you draw cloud system architecture diagrams using code instead of drag-and-drop tools.

πŸ—οΈ Infrastructure as Code Philosophy

Just like Infrastructure as Code (IaC) manages infrastructure through code, Diagrams as Code creates architecture diagrams programmatically.

☁️ Multi-Cloud Support

Diagrams supports all major cloud providers (AWS, Azure, GCP, Kubernetes), on-premise solutions, and SaaS services.

πŸ”— Simple Syntax

The library uses intuitive Python syntax with operators like >> for data flow, - for connections, and list notation [] for parallel components. Clusters group related resources together.

πŸŽ‰ Browser Magic with viz.js!

The Diagrams library generates Graphviz DOT format, which normally requires a native binary. We're using viz.js (Graphviz compiled to WebAssembly) to render the diagrams directly in your browser! The Python code intercepts the graphviz.Digraph class to capture DOT output.

Icon loading: Cloud provider icons are fetched from the diagrams GitHub repository, converted to base64 data URIs, and embedded directly into the SVG.

πŸ’‘ Real-World Use Cases

β€’ Document system architecture in your repository
β€’ Auto-generate diagrams from infrastructure code
β€’ Create visual documentation for technical proposals
β€’ Maintain architecture diagrams alongside code changes
β€’ Generate diagrams in CI/CD pipelines

πŸš€ Getting Started Locally

To use the Diagrams library in a local Python environment:
pip install diagrams
You'll also need Graphviz installed on your system. Visit diagrams.mingrammer.com for full documentation and installation instructions.

View Manager Source | View Diagram Files
Official Examples

🐍 Python Console