---
title: "diagrams | pypx"
description: "Diagram as Code"
canonical_url: "https://pypx.app/packages/diagrams"
meta:
  "og:description": "Diagram as Code"
  "og:image": "https://pypx.app/_og/d/h_630%2Cc_PackageCard%2Cname_diagrams%2Cversion_0.25.1%2Csummary_Diagram%2Bas%2BCode%2Clicense_MIT%2BLicense%2Cp_Ii9wYWNrYWdlcy9kaWFncmFtcyI%2Cs_T4yN0_dCnKB86hCv.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "diagrams 0.25.1"
  "twitter:image": "https://pypx.app/_og/d/h_630%2Cc_PackageCard%2Cname_diagrams%2Cversion_0.25.1%2Csummary_Diagram%2Bas%2BCode%2Clicense_MIT%2BLicense%2Cp_Ii9wYWNrYWdlcy9kaWFncmFtcyI%2Cs_T4yN0_dCnKB86hCv.png"
---

> Index of every page on this site: [llms.txt](https://pypx.app/llms.txt)

# **diagrams**

v0.25.1

Diagram as Code

32.9 MB Python 3.9+ py3-none-anyMIT License4 deps

[** Diff **](https://pypx.app/packages/diagrams/diff)

`$ uv add diagrams`

![diagrams logo](https://pypx.app/assets/img/diagrams.png)

# Diagrams

[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://pypx.app/LICENSE) [![pypi version](https://badge.fury.io/py/diagrams.svg)](https://badge.fury.io/py/diagrams) ![python version](https://img.shields.io/badge/python-%3E%3D%203.9-blue?logo=python) ![Run tests](https://github.com/mingrammer/diagrams/workflows/Run%20tests/badge.svg?branch=master) [![todos](https://badgen.net/https/api.tickgit.com/badgen/github.com/mingrammer/diagrams?label=todos)](https://www.tickgit.com/browse?repo=github.com/mingrammer/diagrams) ![contributors](https://img.shields.io/github/contributors/mingrammer/diagrams)

**Diagram as Code**.

Diagrams lets you draw the cloud system architecture **in Python code**. It was born for **prototyping** a new system architecture design without any design tools. You can also describe or visualize the existing system architecture as well. Diagrams currently supports main major providers including: `AWS`, `Azure`, `GCP`, `Kubernetes`, `Alibaba Cloud`, `Oracle Cloud` etc... It also supports `On-Premises` nodes, `SaaS` and major `Programming` frameworks and languages.

**Diagram as Code** also allows you to **track** the architecture diagram changes in any **version control** system.

> NOTE: It does not control any actual cloud resources nor does it generate cloud formation or terraform code. It is just for drawing the cloud system architecture diagrams.

## Providers

![aws provider](https://img.shields.io/badge/AWS-orange?logo=amazon-aws&color=ff9900) ![azure provider](https://img.shields.io/badge/Azure-orange?logo=microsoft-azure&color=0089d6) ![gcp provider](https://img.shields.io/badge/GCP-orange?logo=google-cloud&color=4285f4) ![ibm provider](https://img.shields.io/badge/IBM-orange?logo=ibm&color=052FAD) ![kubernetes provider](https://img.shields.io/badge/Kubernetes-orange?logo=kubernetes&color=326ce5) ![alibaba cloud provider](https://img.shields.io/badge/AlibabaCloud-orange?logo=alibaba-cloud&color=ff6a00) ![oracle cloud provider](https://img.shields.io/badge/OracleCloud-orange?logo=oracle&color=f80000) ![openstack provider](https://img.shields.io/badge/OpenStack-orange?logo=openstack&color=da1a32) ![firebase provider](https://img.shields.io/badge/Firebase-orange?logo=firebase&color=FFCA28) ![digital ocean provider](https://img.shields.io/badge/DigitalOcean-0080ff?logo=digitalocean&color=0080ff) ![elastic provider](https://img.shields.io/badge/Elastic-orange?logo=elastic&color=005571) ![outscale provider](https://img.shields.io/badge/OutScale-orange?color=5f87bf) ![on premises provider](https://img.shields.io/badge/OnPremises-orange?color=5f87bf) ![generic provider](https://img.shields.io/badge/Generic-orange?color=5f87bf) ![programming provider](https://img.shields.io/badge/Programming-orange?color=5f87bf) ![saas provider](https://img.shields.io/badge/SaaS-orange?color=5f87bf) ![c4 provider](https://img.shields.io/badge/C4-orange?color=5f87bf)

## Getting Started

It requires **Python 3.9** or higher, check your Python version first.

It uses [Graphviz](https://www.graphviz.org/) to render the diagram, so you need to [install Graphviz](https://graphviz.gitlab.io/download/) to use **diagrams**. After installing graphviz (or already have it), install the **diagrams**.

> macOS users can download the Graphviz via `brew install graphviz` if you're using [Homebrew](https://brew.sh).

```
# using pip (pip3)
$ pip install diagrams

# using pipenv
$ pipenv install diagrams

# using poetry
$ poetry add diagrams
```

You can start with [quick start](https://diagrams.mingrammer.com/docs/getting-started/installation#quick-start). Check out [guides](https://diagrams.mingrammer.com/docs/guides/diagram) for more details, and you can find all available nodes list in [here](https://diagrams.mingrammer.com/docs/nodes/aws).

## Examples

| Event Processing | Stateful Architecture | Advanced Web Service |
| --- | --- | --- |
| ![event processing](https://diagrams.mingrammer.com/img/event_processing_diagram.png) | ![stateful architecture](https://diagrams.mingrammer.com/img/stateful_architecture_diagram.png) | ![advanced web service with on-premises](https://diagrams.mingrammer.com/img/advanced_web_service_with_on-premises.png) |

You can find all the examples on the [examples](https://diagrams.mingrammer.com/docs/getting-started/examples) page.

## Contributing

To contribute to diagram, check out [contribution guidelines](https://pypx.app/CONTRIBUTING.md).

> Let me know if you are using diagrams! I'll add you in showcase page. (I'm working on it!) :)

## Who uses it?

[Apache Airflow](https://github.com/apache/airflow) is the most popular data workflow Orchestrator. Airflow uses Diagrams to generate architecture diagrams in their documentation.

[Cloudiscovery](https://github.com/Cloud-Architects/cloudiscovery) helps you to analyze resources in your cloud (AWS/GCP/Azure/Alibaba/IBM) account. It allows you to create a diagram of analyzed cloud resource map based on this Diagrams library, so you can draw your existing cloud infrastructure with Cloudiscovery.

[Airflow Diagrams](https://github.com/feluelle/airflow-diagrams) is an Airflow plugin that aims to easily visualise your Airflow DAGs on service level from providers like AWS, GCP, Azure, etc. via diagrams.

[KubeDiagrams](https://github.com/philippemerle/KubeDiagrams) is a tool to generate Kubernetes architecture diagrams from Kubernetes manifest files, kustomization files, Helm charts, and actual cluster state. [KubeDiagrams](https://github.com/philippemerle/KubeDiagrams) supports all Kubernetes built-in resources, any custom resources, and label-based resource clustering.

## Other languages

- If you are familiar with Go, you can use [go-diagrams](https://github.com/blushft/go-diagrams) as well.

## License

[MIT](https://pypx.app/LICENSE)

## **Details **

<dl>

<dt>Version</dt>
<dd>0.25.1</dd>

<dt>License</dt>
<dd>MIT License</dd>

<dt>Python</dt>
<dd>~=3.9</dd>

<dt>Maintainer</dt>
<dd>mingrammer</dd>

</dl>

## **Links**

- [Homepage](https://diagrams.mingrammer.com)
- [Repository](https://github.com/mingrammer/diagrams)
- [View on PyPI](https://pypi.org/project/diagrams/)

## **Maintainers **

- mingrammer · [mingrammer@gmail.com](mailto:mingrammer@gmail.com)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://pypx.app/#website","@type":"WebSite","description":"The Python Package Index, reimagined. Fast search, dependency insights, download trends, and changelogs — all in one place.","name":"pypx","url":"https://pypx.app/"},{"@id":"https://pypx.app/packages/diagrams#webpage","@type":"WebPage","description":"Diagram as Code","name":"diagrams","url":"https://pypx.app/packages/diagrams","isPartOf":{"@id":"https://pypx.app/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://pypx.app/packages/diagrams"]}]},{"@id":"https://pypx.app/packages/diagrams#/schema/software-application/1","@type":"SoftwareApplication","applicationCategory":"DeveloperApplication","description":"Diagram as Code","license":"MIT License","name":"diagrams","softwareVersion":"0.25.1"}]}
```

## Sitemap

See the full [sitemap](https://pypx.app/sitemap.md) for all pages.
