buildzr is a powerful tool that enables Python developers to create Structurizr models and diagrams seamlessly. With a mix of declarative and procedural syntax, it simplifies software architecture modeling using the C4 model, helping software teams visualize and communicate architectural designs effectively.
buildzr is a powerful Structurizr authoring tool specifically designed for Python developers. This tool enables the declarative or procedural creation of Structurizr models and diagrams, facilitating the transformation of software architecture documentation into code.
What is Structurizr?
Structurizr is an open standard and a suite of tools for crafting software architecture diagrams based on the C4 model, a visual language that clearly depicts software architectures and their interrelationships. With Structurizr, the architecture models and their associations are defined first, which allows for the reuse of these models to convey multiple perspectives, views, and narratives about the architecture.
Key Features of buildzr:
- Intuitive Pythonic Syntax: Utilize Python's context managers (
withstatements) to organize architecture elements in a nested structure that reflects the inherent hierarchy of your architecture. - Programmatic Creation: Employ
buildzr's Domain-Specific Language (DSL) APIs for automating the creation of C4 model diagrams, enhancing productivity. - Advanced Styling Options: Customize visual elements in detail by targeting them through direct references, types, group affiliations, or custom predicates, providing precise visual control over the diagrams.
- Cloud Provider Themes: Effortlessly incorporate AWS, Azure, Google Cloud, Kubernetes, and Oracle Cloud icons into your diagrams, making use of easily discoverable constants rather than memorizing tag strings.
- Enhanced Type Safety: Increase the security of Structurizr diagrams with comprehensive type hints and support for Mypy, ensuring robust type checking.
- Standards Compliance: Align with the Structurizr JSON schema by using
buildzr, which leverages datamodel-code-generator for generating the low-level representation of the Workspace model automatically. - Rich Ecosystem: Build architecture models using Python's extensive libraries and tools, enhancing both the development and modeling process.
Quick Usage Example
Here’s how easy it is to define a workspace using buildzr:
from buildzr.dsl import Workspace, SoftwareSystem, Person, Container, SystemContextView, ContainerView, desc, Group, StyleElements, AWS
with Workspace('w') as w:
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
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",
)
StyleElements(on=[u], **AWS.USER)
StyleElements(on=[api], **AWS.LAMBDA)
StyleElements(on=[database], **AWS.RDS)
w.save()
For a deeper insight into the tool, visit the Quick Start Tutorial and explore the User Guides for comprehensive instructions.
For more information or to contribute to the project, visit the GitHub Repository or check the Roadmap for future features.
No comments yet.
Sign in to be the first to comment.