Skip to main content

spinagram logo

spinagram

Diagrams as code, delivered editable everywhere.
Write a few lines of Python. Get SVG, PNG, PowerPoint with native shapes, and Figma, FigJam or Excalidraw scenes you can keep editing.

Documentation · Getting started · Python guide · Examples

CI Docs PyPI

One source: Python or YAML, rendered by spinagram to SVG, PNG, PowerPoint and Figma

Why spinagram

  • Editable output, not screenshots. PowerPoint slides get native shapes with the text inside and connectors bound to the boxes, so moving a box drags its arrows along. Figma gets real frames and nodes.
  • Python that reads like the picture. users >> lb >> api, groups as with blocks, loops and functions for the repetitive parts. YAML works too, for generated diagrams.
  • No coordinates needed. spinagram sizes every box from its text and icon, nests groups such as an AWS Region, a VPC and its zones, and places everything with one of four layout engines.
  • Brand once, render anywhere. A theme directory holds colours, fonts, styles, icons and page chrome.
  • Thousands of icons. AWS, GCP, Azure, Kubernetes, CNCF, OCI, OpenStack, Terrastruct, Devicon, SVG Logos, self-hosted and network packs download on first use. Add your own from a folder, npm or GitHub.
  • Edit with the mouse. spinagram serve has a canvas editor for YAML diagrams: drop icons and provider zones from a palette, drag, group and connect, and edit properties, while the YAML file stays the source of truth.
  • Built for reviews. spinagram check catches text overflow, spinagram serve previews live, and numbers can come from a facts file with their provenance in every render.

Quick start

pip install "spinagram[all]"            # or: uv add "spinagram[all]"

Say what is connected to what. spinagram sizes, places and styles everything:

from spinagram import Diagram

d = Diagram("Q01", "Web app on AWS", subtitle="No coordinates, laid out automatically")

users = d.box("Users", icon="aws:users")
with d.group("us-east-1", style="aws-region", direction="right"):
    with d.group("VPC", style="aws-vpc", direction="right"):
        lb = d.box("Load balancer", icon="aws:alb")
        api = d.box("API", text="FastAPI on ECS", icon="terrastruct:python")
        with d.group():  # no style: a light "soft" zone
            db = d.box("Orders DB", text="PostgreSQL", icon="terrastruct:postgres")
            cache = d.box("Cache", text="Redis", icon="terrastruct:redis")
    s3 = d.box("Uploads", text="S3 bucket", icon="aws:s3")

users.to(lb, "HTTPS") >> api
api.to(db, "SQL")
api >> [cache, s3]

d.save("out/", formats=["svg", "png", "pptx"])

Web app on AWS, laid out automatically

  • d.box(...) adds a node; its size comes from its text and icon. No coordinates needed.
  • a >> b draws an arrow, a.to(b, "label") a labelled one, a >> [b, c] fans out.
  • with d.group(...) nests nodes in a zone (an AWS Region, a VPC, or any style from your theme).
  • d.save() writes the files; in Jupyter the diagram shows inline. spinagram serve file.py previews it live.
The same diagram in YAML
id: Q01
title: Web app on AWS
subtitle: No coordinates, laid out automatically
groups:
  - id: region
    label: us-east-1
    style: aws-region
    direction: right
    children:
      - id: vpc
        label: VPC
        style: aws-vpc
        direction: right
        children: [lb, api, data]
      - s3
  - {id: data, children: [db, cache]}
nodes:
  - {id: users, title: Users, icon: "aws:users"}
  - {id: lb, title: Load balancer, icon: "aws:alb"}
  - {id: api, title: API, text: FastAPI on ECS, icon: "terrastruct:python"}
  - {id: db, title: Orders DB, text: PostgreSQL, icon: "terrastruct:postgres"}
  - {id: cache, title: Cache, text: Redis, icon: "terrastruct:redis"}
  - {id: s3, title: Uploads, text: S3 bucket, icon: "aws:s3"}
edges:
  - "users -> lb: HTTPS"
  - lb -> api
  - "api -> db: SQL"
  - api -> cache
  - api -> s3
spinagram render examples/quickstart.yaml -f svg,png,pptx -o out/

Need pixel-exact slides instead? Give nodes coordinates (manual layout), or freeze an automatic layout with spinagram layout spec.py -o frozen.yaml and tune it by hand.

Flowcharts, state machines, activities and CSS

Flowchart, StateMachine and Activity builders add the symbols and verbs of behavior diagrams (decisions, forks and joins, swimlanes, composite states) laid out by a built-in layered engine, and with d.state_machine(...) puts one inside any diagram. A CSS subset styles everything: d.stylesheet("brand.css"), class_="critical", edge.async { stroke-dasharray: 6 4 }. spinagram check --styles explains which rule set each value, spinagram serve has a click-to-inspect styles panel and re-renders when a stylesheet is saved. See behavior diagrams, CSS styling and CSS by backend (what SVG, PowerPoint and Figma do with each property). examples/showcase has AWS, Kubernetes and Google Cloud reference architectures styled only with CSS.

Order fulfilment activity with swimlanes

Outputs

Format What you get
svg Self-contained SVG with fonts and images embedded
png 2x PNG rendered from the SVG
pptx One slide per diagram with native shapes, bound connectors and native tables
figma Figma Plugin-API scripts that build native, editable nodes
figjam A FigJam board with connectors bound to the boxes
excalidraw An editable Excalidraw scene: native shapes, arrows bound to the boxes, embedded icons

Learn more

The documentation (searchable) covers:

  • Automatic layout: groups and the flex, dot, elk and d2 engines
  • Icon packs (AWS, Google Cloud, Azure, Kubernetes, CNCF projects, AI, about 2,000 technology logos, languages, self-hosted and network gear) and themes
  • Annotations: legends, numbered steps, callouts and designed notes
  • Facts: numbers with traceable sources
  • Figma and FigJam hand-off, and Excalidraw scenes
  • CLI, the live UI and its canvas editor
  • Edit API: patch a diagram's YAML from Python with the canvas's edit operations
  • AI agent skills: spinagram skills install --agent claude|codex|cursor|gemini|copilot|… teaches your coding agent to write and style diagrams
  • MCP server: spinagram mcp install -a claude|codex|cursor|gemini|copilot|opencode lets any MCP agent render, check and preview diagrams without a shell
  • Release notes: what's new in each version
  • Extending with your own backends and layout engines

Development

uv sync --all-extras && uv run pytest
cd docs && bun install && bun run dev  # docs at http://localhost:3000

uv sync builds the Rust engine in rust/, so it needs a Rust toolchain. See Development for the UI frontend, docs and releases.

Changelog and license

See CHANGELOG.md for what changed in each release. spinagram is released under the MIT License. Icon packs are downloaded from their upstream projects on first use and keep their own licenses (listed by spinagram icons list).

Metadata

Release files for spinagram 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spinagram 0.6.0
File Size Uploaded Provenance Actions
spinagram-0.6.0.tar.gz 1.7 MB Without provenance Details for spinagram-0.6.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for spinagram 0.6.0
File Actions
spinagram-0.6.0-cp311-abi3-win_arm64.whl CPython 3.11 abi3 Windows ARM64 Details for spinagram-0.6.0-cp311-abi3-win_arm64.whl
spinagram-0.6.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for spinagram-0.6.0-cp311-abi3-win_amd64.whl
spinagram-0.6.0-cp311-abi3-musllinux_1_2_x86_64.whl CPython 3.11 abi3 Linux musl 1.2+ x86-64 Details for spinagram-0.6.0-cp311-abi3-musllinux_1_2_x86_64.whl
spinagram-0.6.0-cp311-abi3-musllinux_1_2_aarch64.whl CPython 3.11 abi3 Linux musl 1.2+ ARM64 Details for spinagram-0.6.0-cp311-abi3-musllinux_1_2_aarch64.whl
spinagram-0.6.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64 Details for spinagram-0.6.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
spinagram-0.6.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details for spinagram-0.6.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
spinagram-0.6.0-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for spinagram-0.6.0-cp311-abi3-macosx_11_0_arm64.whl
spinagram-0.6.0-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details for spinagram-0.6.0-cp311-abi3-macosx_10_12_x86_64.whl

Total release size: 39.4 MB

Release files / spinagram-0.6.0.tar.gz

Download URL spinagram-0.6.0.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
8e2f89cdaff721c0267eba0e8a69aa9385dcf73ab31c3ba89247a675a23b67ce
BLAKE2b-256 checksum
How to use checksums
79daf77c12265818c307d1cb0beb05e4e3c2b8bac3a00260188a6f2689b98705
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / spinagram-0.6.0-cp311-abi3-win_arm64.whl

Download URL spinagram-0.6.0-cp311-abi3-win_arm64.whl
Size 4.4 MB
Tags CPython 3.11 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
91ada2b4ec1456385633d0dc5562df2655a558469045b9938d5ea960cce8a015
BLAKE2b-256 checksum
How to use checksums
a3737848b2422ede83654afc91ac778b01275c34195aedf27a268222e83a11ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / spinagram-0.6.0-cp311-abi3-win_amd64.whl

Download URL spinagram-0.6.0-cp311-abi3-win_amd64.whl
Size 4.6 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
01ba89e13adcc8c8da72b7defccefe9905f01d502a5ea471a400a946f59182f5
BLAKE2b-256 checksum
How to use checksums
3ff9a4f37993bfe0138cb8fb143e7b15c475ad10d59ca955d66fac6dce55e27a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / spinagram-0.6.0-cp311-abi3-musllinux_1_2_x86_64.whl

Download URL spinagram-0.6.0-cp311-abi3-musllinux_1_2_x86_64.whl
Size 5.1 MB
Tags CPython 3.11 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
ca87e9d34daf04933a4e71b401d9b5685b5444a553901579bf35b60a046e2695
BLAKE2b-256 checksum
How to use checksums
eae0670ce9a4c0784c175ba82dec1633b82786edacd77e1eb4cac0fe0e62f900
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / spinagram-0.6.0-cp311-abi3-musllinux_1_2_aarch64.whl

Download URL spinagram-0.6.0-cp311-abi3-musllinux_1_2_aarch64.whl
Size 4.9 MB
Tags CPython 3.11 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
22604943d2c9157901a4b7ea7b51bb17e5de030b577e1e80eefd065d685c478a
BLAKE2b-256 checksum
How to use checksums
f90effa7dd713c30c6ea289273ae77d3f70935ba4de8f5824e3f96f32f07c3db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / spinagram-0.6.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL spinagram-0.6.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 4.9 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
82b37f289738999fac5b249f709f3b1ab475a026c0ac0471b63bcb77f38ef1e7
BLAKE2b-256 checksum
How to use checksums
8c58ce3273730dd455e8fc02152cedd3ba63e8ad8857ff3106e864b3eb4c6c91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / spinagram-0.6.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL spinagram-0.6.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 4.7 MB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
5eb8512e8f9a611515d40420481db49bcd539c58876337528a8445a6e973a27d
BLAKE2b-256 checksum
How to use checksums
29835a08729bc45ac272a04b536dba1b8881916347f1d70e3d27dac712d347a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / spinagram-0.6.0-cp311-abi3-macosx_11_0_arm64.whl

Download URL spinagram-0.6.0-cp311-abi3-macosx_11_0_arm64.whl
Size 4.5 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6a52a7f6f60d6e4566c3dc1c99ceb73d9aced08fefa8254e7ce07db7cf9c0f8f
BLAKE2b-256 checksum
How to use checksums
e14bbfde94d8f27e26ceaf917eeaa163c96289d10fe7b193f8a57f36d427a7be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / spinagram-0.6.0-cp311-abi3-macosx_10_12_x86_64.whl

Download URL spinagram-0.6.0-cp311-abi3-macosx_10_12_x86_64.whl
Size 4.6 MB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
7cf86637235e61aa1931e2603ddca71320ad6b6a044d175c42f88fcae849e62c
BLAKE2b-256 checksum
How to use checksums
252c53ebd506d119f64d7642d3b99ac732ee19c3627f4603ae822774c3ba54f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for spinagram 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page