Skip to main content

Structurizr for the buildzrs 🧱⚒️

Build PyPI version Python versions

buildzr is a Structurizr authoring tool for Python programmers. It allows you to declaratively or procedurally author Structurizr models and diagrams.

If you're not familiar with Structurizr, it is both an open standard (see Structurizr JSON schema) and a set of tools for building software architecture diagrams as code. Structurizr derives its architecture modeling paradigm based on the C4 model, the modeling language for describing software architectures and their relationships.

In Structurizr, you define architecture models and their relationships first. And then, you can re-use the models to present multiple perspectives, views, and stories about your architecture.

buildzr supercharges this workflow with Pythonic syntax sugar and intuitive APIs that make modeling as code more fun and productive.

Install

pip install buildzr

Quick Example

from buildzr.dsl import (
    Workspace,
    SoftwareSystem,
    Person,
    Container,
    SystemContextView,
    ContainerView,
    desc,
    Group,
    StyleElements,
)
from buildzr.themes import AWS

with Workspace('w') as w:

    # Define your models (architecture elements and their relationships).

    with Group("My Company") as my_company:
        u = Person('Web Application User')
        webapp = SoftwareSystem('Corporate Web App')
        with webapp:
            database = Container('database')
            api = Container('api')
            api >> ("Reads and writes data from/to", "http/api") >> database
    with Group("Microsoft") as microsoft:
        email_system = SoftwareSystem('Microsoft 365')

    u >> [
        desc("Reads and writes email using") >> email_system,
        desc("Create work order using") >> webapp,
    ]
    webapp >> "sends notification using" >> email_system

    # Define the views.

    SystemContextView(
        software_system_selector=webapp,
        key='web_app_system_context_00',
        description="Web App System Context",
        auto_layout='lr',
    )

    ContainerView(
        software_system_selector=webapp,
        key='web_app_container_view_00',
        auto_layout='lr',
        description="Web App Container View",
    )

    # Stylize the views, and apply AWS theme icons.

    StyleElements(on=[u], **AWS.USER)
    StyleElements(on=[api], **AWS.LAMBDA)
    StyleElements(on=[database], **AWS.RDS)

    # Export to JSON, PlantUML, or SVG.

    w.save()                                  # JSON to {workspace_name}.json

    # Requires `pip install buildzr[export-plantuml]`
    w.save(format='plantuml', path='output/') # PlantUML files
    w.save(format='svg', path='output/')      # SVG files

Example Software System View Example Container View

Getting Started

Ready to dive in? Check out the Quick Start Tutorial and User Guides.

Why use buildzr?

Intuitive Pythonic Syntax: Use Python's context managers (with statements) to create nested structures that naturally mirror your architecture's hierarchy. See the example.

Programmatic Creation: Use buildzr's DSL APIs to programmatically create C4 model architecture diagrams. Great for automation!

Advanced Styling: Style elements beyond just tags --- target by direct reference, type, group membership, or custom predicates for fine-grained visual control. Just take a look at Styles!

Cloud Provider Themes: Add AWS, Azure, Google Cloud, Kubernetes, and Oracle Cloud icons to your diagrams with IDE-discoverable constants. No more memorizing tag strings! See Themes.

Type Safety: Write Structurizr diagrams more securely with extensive type hints and Mypy support.

Standards Compliant: Stays true to the Structurizr JSON schema standards. buildzr uses datamodel-code-generator to automatically generate the low-level representation of the Workspace model.

Rich Toolchain: Uses the familiar Python programming language and its rich toolchains to write software architecture models and diagrams!

Project Links

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

buildzr-0.0.31.tar.gz (191.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

buildzr-0.0.31-py3-none-any.whl (21.0 MB view details)

Uploaded Python 3

File details

Details for the file buildzr-0.0.31.tar.gz.

File metadata

  • Download URL: buildzr-0.0.31.tar.gz
  • Upload date:
  • Size: 191.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for buildzr-0.0.31.tar.gz
Algorithm Hash digest
SHA256 0c6a7cbf92c3d77d0a2677b6cad3234a6b4f516cacd20c271649ea1f20f10e84
MD5 e2d3127f822743ee2b777a8ed4ffb1eb
BLAKE2b-256 7ce6f05e04221585d2140f27da5806bba74d5063a0cb17e21a3a00508469dfec

See more details on using hashes here.

File details

Details for the file buildzr-0.0.31-py3-none-any.whl.

File metadata

  • Download URL: buildzr-0.0.31-py3-none-any.whl
  • Upload date:
  • Size: 21.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for buildzr-0.0.31-py3-none-any.whl
Algorithm Hash digest
SHA256 ede69dd627886f6a04b376f35f39512542decdf4bd1c1176367304a07eabc7f1
MD5 61f98d5a6da15097119df355ae1cbef4
BLAKE2b-256 7be503929fe9b1cd9b91a484aa3758167c36ef89761f490f612cf21260f77b4d

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.31 This release

2 files

0.0.30

2 files

0.0.29

2 files

0.0.28

2 files

0.0.27

2 files

0.0.26

2 files

0.0.25

2 files

0.0.24

2 files

0.0.23

2 files

0.0.22

2 files

0.0.21

2 files

0.0.20

2 files

0.0.19

2 files

0.0.18

2 files

0.0.17

2 files

0.0.16

2 files

0.0.15

2 files

0.0.14

2 files

0.0.13

2 files

0.0.12

2 files

0.0.11

2 files

0.0.10

2 files

0.0.9

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

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