spinagram
Examples

Slides that explain themselves

Numbered steps, callouts, legends and designed notes, plus diagrams generated from data.

An annotated architecture

Numbered steps on the arrows, a Steps panel, a callout and a legend, all from four lines of code. This is step 4 of the tutorial.

examples/tutorial/step4_explain.py
"""Tutorial step 4: numbered steps, a callout and a legend explain the diagram on the slide."""
from spinagram import Diagram

d = Diagram("T04", "Checkout", subtitle="Step 4: explain it with steps, callouts and a legend")

shoppers = d.box("Shoppers", icon="aws:users")
with d.group("AWS eu-west-1", style="aws-region", direction="right"):
    store = d.box("Storefront", text="CloudFront", icon="aws:cloudfront")
    with d.group("VPC", style="aws-vpc", direction="right"):
        orders = d.box("Orders API", text="FastAPI on ECS", icon="terrastruct:python")
        with d.group("Data"):
            db = d.box("Orders DB", text="PostgreSQL", icon="terrastruct:postgres")
            cache = d.box("Cache", text="Redis", icon="terrastruct:redis")
            queue = d.box("Events", text="SQS queue", icon="aws:sqs")

shoppers.to(store, "HTTPS", step="Shopper opens the cart")
store.to(orders, step="Storefront posts the order")
orders.to(db, "SQL", step="Order is stored")
orders >> cache
orders.to(queue, step="Fulfilment is notified")

d.callout(shoppers, "40k checkouts an hour on sale days", title="Peak load", kind="warning", side="bottom")
d.add_legend({"aws:users": "People", "terrastruct:python": "Service", "aws:sqs": "Async messaging"})

The checkout with numbered steps, a callout and a legend

Decision slides

Use it for: architecture decision records, review summaries, open questions.

Notes come in three variants: card (with an icon and an accent bar), quote and sticky. Give them coordinates for a designed, pixel-exact slide:

d.note("Aurora PostgreSQL", text="Managed backups and point-in-time recovery.",
       variant="card", icon="aws:amazon-aurora", x=80, y=200, w=540, h=210)
d.note("Werner Vogels", text="Everything fails, all the time.", variant="quote", x=80, y=520, w=1150, h=300)
d.note("Open question", text="Do we need a second region before the EU launch?", x=1300, y=520, w=540, h=140)

Architecture decisions slide with cards, a quote and open questions

Full file: notes.py · Annotations · Manual layout

Diagrams from data

Use it for: diagrams generated from an inventory, a CMDB or another tool.

Everything works as YAML too, which any program can write. Edges have a one-line shorthand:

id: Q01
title: Web app
nodes:
  - {id: lb, title: Load balancer, icon: "aws:alb"}
  - {id: api, title: API, text: FastAPI, icon: "terrastruct:python"}
edges:
  - "lb -> api: HTTPS"
spinagram render specs/ -f svg,pptx -o out/

YAML specs →

On this page