infrasketch
Draw Azure architecture diagrams as SVG. The package uses the official Azure resource icons and lays the diagram out itself, so Graphviz is not required.
from infrasketch import Diagram, FrontDoor, FunctionApp, Redis, ResourceGroup
with Diagram("Orders", "orders.svg"):
with ResourceGroup("rg-app"):
web = FrontDoor("Frontend")
api = FunctionApp("API")
cache = Redis("Sessions")
web >> api >> cache
That writes orders.svg when the block ends. The icon says which Azure
service it is. The label is your name for that piece of the system, and the
caption under it is the service name.
Install
pip install infrasketch
Documentation
The guide and the searchable icon browser are published at antsticky.github.io/infrasketch.
Draw a diagram
Resources only exist inside a diagram. Groups are context managers too, so the indentation is the architecture:
from infrasketch import (
Diagram, Edge, Https, Private,
ResourceGroup, VNet, Subnet, PrivateNetwork,
Users, FrontDoor, StaticWebApp, AppService, Redis, SQLDatabase, KeyVault,
)
with Diagram("Web, API, and Redis", "platform.svg", subtitle="Production · West Europe"):
customers = Users("Customers")
with ResourceGroup("rg-edge"):
door = FrontDoor("Entry")
with ResourceGroup("rg-app"):
with VNet("vnet-app"):
with Subnet("snet-web"):
web = StaticWebApp("Storefront")
with Subnet("snet-api"):
api = AppService("Orders API")
with PrivateNetwork("data"):
cache = Redis("Sessions")
database = SQLDatabase("Orders")
vault = KeyVault("Secrets")
customers >> Https() >> door >> web >> api
api >> [cache, database]
api >> Private("secrets") >> vault
direction="TB" flows top to bottom. spacing is "compact", "regular",
or "relaxed". Pass autosave=False when you want the SVG string yourself:
with Diagram("Orders", autosave=False) as diagram:
...
svg = diagram.svg()
diagram.save("orders.svg")
Connectors
| Code | Result |
|---|---|
a >> b |
Arrow from a to b |
a >> [b, c] |
Arrow from a to each target |
[a, b] >> c |
Arrow from each source to c |
a << b |
Arrow pointing back at a |
a - b |
Line with no arrowhead |
a >> Edge("SQL", style="dashed") >> b |
Labelled connector |
a >> Https() >> b |
Azure-blue HTTPS |
a >> Async("enqueue") >> b |
Dashed queue or event |
a >> Private() >> b |
Dashed Private Link |
style is "solid", "dashed", or "dotted". color is a hex color such
as "#0078D4".
Boundaries
| Group | Use it for |
|---|---|
Subscription("sub") |
A subscription |
ResourceGroup("rg-app") |
A resource group |
Region("West Europe") |
A region |
VNet("vnet-app") |
A virtual network |
Subnet("snet-api") |
A subnet |
PrivateNetwork("data") |
Private endpoints or Private Link |
Group("Workers") |
Anything else |
Inside a boundary, connected resources flow in the diagram direction.
Resources at the same step stack, which is what you want for a cache beside
its database. arrange="row" forces a single row, arrange="column" a
single column, and arrange="grid" with columns=3 a grid.
Finding an icon
Common resources have short names: FunctionApp, ContainerApp, ACR,
AKS, Redis, ManagedRedis, SQLDatabase, CosmosDB, PostgreSQL,
StorageAccount, KeyVault, FrontDoor, ApplicationGateway,
ServiceBus, StaticWebApp.
Everything in the Azure icon set is included. Search when you need the rest:
python -m infrasketch search private endpoint
python -m infrasketch search container registry
python -m infrasketch categories
from infrasketch import search
for hit in search("cosmos"):
print(hit.import_line)
from infrasketch.networking import Bastions
FunctionApp("Orders") labels the box "Orders" and captions it "Function App".
FunctionApp() uses the service name as the only label. caption=False hides
the caption.
A resource with no icon draws a neutral placeholder. Pass icon="path/to.svg"
to use your own artwork. Azure icons are never recoloured or stretched.
Examples
| Script | What it shows |
|---|---|
examples/web_api_redis.py |
Front Door, static web app, API, Redis, SQL, Key Vault |
examples/container_apps.py |
ACR, Container Apps, private endpoints |
examples/functions_events.py |
API Management, functions, Service Bus, Cosmos DB, storage |
examples/aks_platform.py |
AKS, ACR, firewall, PostgreSQL, managed Redis |
License
The package license expression is
MIT AND LicenseRef-Microsoft-Azure-Architecture-Icons.
The Python code is MIT. See LICENSE.
The SVG files in src/infrasketch/data/icons are Microsoft Azure Architecture
Icons (V25). They are not MIT. Their identifier is
LicenseRef-Microsoft-Azure-Architecture-Icons. Microsoft allows them in architecture diagrams,
training materials, and documentation only. Do not crop, flip, rotate, recolor,
or reshape them, and do not use them as a logo or to represent your own
product. The terms travel with the files in NOTICE and
src/infrasketch/data/icons/LICENSE.txt.
Metadata
Release files for infrasketch 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| infrasketch-0.1.0.tar.gz | 585.5 kB | With provenance | Details for infrasketch-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| infrasketch-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for infrasketch-0.1.0-py3-none-any.whl |
Total release size: 1.5 MB
Release files / infrasketch-0.1.0.tar.gz
| Download URL | infrasketch-0.1.0.tar.gz |
|---|---|
| Size | 585.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
09c39cfb56e1e532f58a5252ef88bc512cfe1dcb627dd095041e798d82ab5e4b
|
|
BLAKE2b-256 checksum How to use checksums |
4290abb785c538177db11c7118a0233bfbcf2fd75a351e9faa052dc6f4d5f599
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.
Transparency logRelease files / infrasketch-0.1.0-py3-none-any.whl
| Download URL | infrasketch-0.1.0-py3-none-any.whl |
|---|---|
| Size | 895.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
87f2292e3a671dfbcc69a08c0c79ee396c5c38277ea63f38898540a895969dab
|
|
BLAKE2b-256 checksum How to use checksums |
7ab88f4242e04981163c2a53460d5ded7399c974713f4e1e853d67f12a8efbb6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.
Transparency logSecurity for infrasketch 0.1.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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for infrasketch-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.
Transparency logA 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.