Code-based Diagramming

Draw diagrams programmatically.

6 min readJan 24, 2022
Photo by Hanna Morris on Unsplash

We talked about text-based diagramming using Mermaid and Vite, and text-based diagramming in writing technical documentation. In this article, we will go through open source libraries that can help us generate diagrams programmatically.

Diagrams for Python

Diagrams helps us draw on-premise and cloud system architecture in Python code.

It supports all major cloud providers like AWS, Azure, GCP, IBM, OpenStack, DigitalOcean, Oracle, Firebase, and other platforms like Kubernetes, Saas, and Elastic search services.

Below are some examples taken from the documentation.


AWS System Architecture





Software engineer, Data Science and ML practitioner.