Skip to main content

Structurizr for the `buildzr`s 🧱⚒️

Project description

Structurizr for the buildzrs 🧱⚒️

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,
)

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', tags={'db'})
            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.

    StyleElements(
        on=[u],
        shape='Person',
        background='blue',
    )

    StyleElements(
        on=['db'],
        shape='Cylinder'
    )

    # Export to JSON.

    w.to_json('workspace.json')

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 below.

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!

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

Project details


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.27.tar.gz (72.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.27-py3-none-any.whl (44.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: buildzr-0.0.27.tar.gz
  • Upload date:
  • Size: 72.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for buildzr-0.0.27.tar.gz
Algorithm Hash digest
SHA256 c4177b81f9b51786979f00e254de91c108b0dfe686354b23847c586903d3102b
MD5 17ea76c8dd4418e2a590679528fd3d57
BLAKE2b-256 dc5e3f56f3247ee951e1cb96f2f630d4b24f65d4077982271ae5d7eb92e98ca6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: buildzr-0.0.27-py3-none-any.whl
  • Upload date:
  • Size: 44.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for buildzr-0.0.27-py3-none-any.whl
Algorithm Hash digest
SHA256 513dec249e60f379ccecd06b62bbadb8752b2db62d9226df6ce030bf750f310b
MD5 e4cf047f40bc0f7dd6ead1dfb751a7ff
BLAKE2b-256 eaa1e8fc0dc94cbf5c5aeb62db4c30aafaa765ee208ff4da2615497edc4c8787

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page