Small Cool Tool - Python Diagrams

My experience with the Python Diagrams package

I just wanted to talk about a cool tool I found and used. This will be quick but if you want a TLDR then here it is: There is a Python package called Diagrams. It's pretty cool if you want to code up your thoughts vs fighting with a diagram tool like draw.io.

Diagram demo with a load balancer connected to an EC2 instance

Python Diagram Package

The python diagram package is an amazing package. I'm not sure how I found it but I think it solves a major documentation pain point. If you know me then you know I'm all about documentation (that's kinda what this site is after all). As a dev, learning diagraming tools feels very stressful and useless. I've done the work learning how to diagram just a little over the years, but I will take any chance possible to not have to deal with design-ish activities.

The diagram package takes the guesswork out of finding the right image and seems pretty straight forward to build. I only did 2 aws services in the demo above because I feel like this is a very simple diagram. I'll post the code below don't worry. The last point I want to make here is that this is Python. This is important because in the cloud space especially python is king(it seems).

Don't want to leave your Python scripting world to explain the new architecture your trying then this is for you. Check the website for more examples.

from diagrams import Diagram
from diagrams.aws.compute import EC2
from diagrams.aws.network import ELB

with Diagram("Demo", show=False):
	ELB("demo-lb") >> EC2("demo-ec2")