buildzr 0.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,140 @@
1
+ Metadata-Version: 2.3
2
+ Name: buildzr
3
+ Version: 0.0.1
4
+ Summary: Structurizr for the `buildzr`s 🧱⚒️
5
+ Project-URL: homepage, https://github.com/amirulmenjeni/buildzr
6
+ Project-URL: issues, https://github.com/amirulmenjeni/buildzr/issues
7
+ Author-email: Amirul Menjeni <amirulmenjeni@pm.me>
8
+ License-File: LICENSE.md
9
+ Keywords: architecture,buildzr,c4model,design,diagram,structurizr
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.8
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Requires-Python: >=3.8
20
+ Requires-Dist: pyhumps==3.8.0
21
+ Requires-Dist: pytest>=8.3.3
22
+ Provides-Extra: dev
23
+ Requires-Dist: datamodel-code-generator==0.26.2; extra == 'dev'
24
+ Requires-Dist: jsondiff==2.0.0; extra == 'dev'
25
+ Requires-Dist: mypy-extensions==1.0.0; extra == 'dev'
26
+ Requires-Dist: mypy==1.11.2; extra == 'dev'
27
+ Requires-Dist: pytest-mypy==0.10.3; extra == 'dev'
28
+ Requires-Dist: yq==3.4.3; extra == 'dev'
29
+ Description-Content-Type: text/markdown
30
+
31
+ # Structurizr for the `buildzr`s 🧱⚒️
32
+
33
+ `buildzr` is a [Structurizr](https://structurizr.com/) authoring tool for Python programmers.
34
+
35
+ If you're not familiar with Structurizr, it is both an open standard (see [Structurizr JSON schema](https://github.com/structurizr/json)) and a [set of tools](https://docs.structurizr.com/usage) for building software architecture diagrams as code. Structurizr derive its architecture modeling paradigm based on the [C4 model](https://c4model.com/), the modeling language for visualizing software architecture.
36
+
37
+ `buildzr` offers flexible and fluent APIs to write software architecture models based on the C4 model, leveraging the standard Structurizr JSON schema for interoperability with various rendering and authoring tools.
38
+
39
+ # Quick Start 🚀
40
+
41
+ ## Installation
42
+
43
+ _TODO_
44
+
45
+ ## Creating a workspace
46
+
47
+ The module `buildzr.dsl` contains all the classes you need to create a workspace containing all the architecture models.
48
+
49
+ Below is an example, where we:
50
+ 1. Create the models (`Person`, `SoftwareSystem`s, the `Container`s inside the `SoftwareSystem`, and the relationships between them)
51
+ 2. Define multiple views using the models we've created before.
52
+
53
+ ```python
54
+ import os
55
+ import json
56
+
57
+ from buildzr.encoders import JsonEncoder
58
+
59
+ from buildzr.dsl import (
60
+ Workspace,
61
+ SoftwareSystem,
62
+ Person,
63
+ Container,
64
+ SystemContextView,
65
+ ContainerView,
66
+ desc,
67
+ Group,
68
+ )
69
+
70
+ w = Workspace('w')\
71
+ .contains(
72
+ Group(
73
+ "My Company",
74
+ Person('Web Application User').labeled('u'),
75
+ SoftwareSystem('Corporate Web App').labeled('webapp')
76
+ .contains(
77
+ Container('database'),
78
+ Container('api'),
79
+ )\
80
+ .where(lambda s: [
81
+ s.api >> "Reads and writes data from/to" >> s.database,
82
+ ])
83
+ ),
84
+ Group(
85
+ "Microsoft",
86
+ SoftwareSystem('Microsoft 365').labeled('email_system'),
87
+ )
88
+ )\
89
+ .where(lambda w: [
90
+ w.person().u >> [
91
+ desc("Reads and writes email using") >> w.software_system().email_system,
92
+ desc("Create work order using") >> w.software_system().webapp,
93
+ ],
94
+ w.software_system().webapp >> "sends notification using" >> w.software_system().email_system,
95
+ ])\
96
+ .with_views(
97
+ SystemContextView(
98
+ lambda w: w.software_system().webapp,
99
+ key='web_app_system_context_00',
100
+ description="Web App System Context",
101
+ auto_layout='lr',
102
+ exclude_elements=[
103
+ lambda w, e: w.person().user == e,
104
+ ]
105
+ ),
106
+ ContainerView(
107
+ lambda w: w.software_system().webapp,
108
+ key='web_app_container_view_00',
109
+ auto_layout='lr',
110
+ description="Web App Container View",
111
+ )
112
+ )\
113
+ .get_workspace()
114
+
115
+ # Writes the Workspace model to a JSON file.
116
+ with open(os.path.join(os.path.curdir, f"{__file__.split('.')[0]}.json"), 'w', encoding='utf-8') as f:
117
+ json.dump(w.model, f, ensure_ascii=False, indent=4, cls=JsonEncoder)
118
+ ```
119
+
120
+ That's it 😊!
121
+
122
+ The JSON output can be found [here](examples/system_context_and_container_view.json). You can also try out https://structurizr.com/json to see how this workspace will be rendered.
123
+
124
+ # Why use `buildzr`?
125
+
126
+ ✅ Uses fluent APIs to help you create C4 model architecture diagrams in Python concisely.
127
+
128
+ ✅ Write Structurizr diagrams more securely with extensive type hints and [mypy](https://mypy-lang.org) support.
129
+
130
+ ✅ Stays true to the [Structurizr JSON schema](https://mypy-lang.org/) standards. `buildzr` uses the [datamodel-code-generator](https://github.com/koxudaxi/datamodel-code-generator) to automatically generate the "low-level" [representation](buildzr/models/models.py) of the Workspace model. This reduces deprecancy between `buildzr` and the Structurizr JSON schema.
131
+
132
+ ✅ Writing architecture diagrams in Python allows you to integrate programmability and automation into your software architecture diagramming and documentation workflow.
133
+
134
+ ✅ Uses the familiar Python programming language to write predicates for including/excluding elements and relationships in views.
135
+
136
+ # Contributing
137
+
138
+ Interested in contributing to `buildzr`?
139
+
140
+ Please visit [CONTRIBUTING.md](CONTRIBUTING.md).
@@ -0,0 +1,20 @@
1
+ buildzr/__about__.py,sha256=t_QiCcOQDjV4pl-PMvif1IH68nAKKe0wdeizhaDsDds,17
2
+ buildzr/__init__.py,sha256=hY-cOdjBQcz0v2m8cBF1oEJFIbcR3sWI-xww--0RKSo,99
3
+ buildzr/dsl/__init__.py,sha256=paxuMCCDuOs1eSvBPyuW5pv5j1UZD6TxRZcCzC2iKss,307
4
+ buildzr/dsl/dsl.py,sha256=X5lJJhD9dQ7YlRAECdXJb9qJKWfrfi-1H5rESYOnGhI,34584
5
+ buildzr/dsl/explorer.py,sha256=numMPqD3RYJ1oeMgX5wYnT6aHRHmBN2EsFZFYRuFffA,2523
6
+ buildzr/dsl/expression.py,sha256=UinOUL3nJytZR8ylnVtVkJ0YoWoWspU9DQeDpg0nIEQ,6927
7
+ buildzr/dsl/relations.py,sha256=aIXtbvpwSeW3QpWD_whtiIP8AOYPOpfCtFIrhM8NIkc,12253
8
+ buildzr/dsl/factory/__init__.py,sha256=niaYqvNPUWJejoPyRyABUtzVsoxaV8eSjzS9dta4bMI,30
9
+ buildzr/dsl/factory/gen_id.py,sha256=LnaeOCMngSvYkcGnuARjQYoUVWdcOoNHO2EHe6PMGco,538
10
+ buildzr/dsl/interfaces/__init__.py,sha256=T0Az1IDLsTUYHoaGBStbS5V-acaJAlFUpDo-6Q0MrOY,229
11
+ buildzr/dsl/interfaces/interfaces.py,sha256=Y3mqvXpiiZ-GRq3LhHAONq0Ft-Qzn40wje8zynHWJpM,4957
12
+ buildzr/encoders/__init__.py,sha256=suID63Ay-023T0uKD25EAoGYmAMTa9AKxIjioccpiPM,32
13
+ buildzr/encoders/encoder.py,sha256=9_FlQ3aYvz0EcN_G9A3bPdqxCTkLhc2OrYXSYti95f8,2237
14
+ buildzr/models/__init__.py,sha256=SRfF7oDVlOOAi6nGKiJIUK6B_arqYLO9iSMp-2IZZps,21
15
+ buildzr/models/generate.sh,sha256=924UoEXr5WBZ926TZfRgEQGHwBqtLGU5k0G2UfExLEg,1061
16
+ buildzr/models/models.py,sha256=0LhLG1wmbt4dvROV5MEBZLLoxPbMpkUsOqNz525cynE,42489
17
+ buildzr-0.0.1.dist-info/METADATA,sha256=MeUQrhtTNUePTVwRFQn0jdw74IDqV7MIzKoaELGBksE,5573
18
+ buildzr-0.0.1.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
19
+ buildzr-0.0.1.dist-info/licenses/LICENSE.md,sha256=e8e6W6tL4MbBY-c-gXMgDbaMf_BnaQDQv4Yoy42b-CI,1070
20
+ buildzr-0.0.1.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.25.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Amirul Menjeni
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.