Skip to content
This repository was archived by the owner on Jan 21, 2023. It is now read-only.

Commit 254bc16

Browse files
committed
docs: create initial documentation
1 parent 72b2570 commit 254bc16

File tree

4 files changed

+92
-7
lines changed

4 files changed

+92
-7
lines changed

docs/.pages

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
nav:
2+
- Home: index.md
3+
- Issue Tracker: https://github.com/Midnighter/structurizr-python/issues/
4+
- Development Plan: https://github.com/Midnighter/structurizr-python/projects/1/
5+
- adr

docs/adr/.pages

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
title: Architecture Decision Records
2+
3+
nav:
4+
- ...

docs/index.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Structurizr for Python
2+
3+
A Python client package for the [Structurizr](https://structurizr.com/) cloud
4+
service and on-premises installation.
5+
6+
## Installation
7+
8+
For the moment, the main installation method is from PyPI, for example, using
9+
`pip`.
10+
11+
```
12+
pip install structurizr-python
13+
```
14+
15+
## Getting Started
16+
17+
There are two starting points. Either you have no Structurizr workspace or you
18+
have an existing workspace that you want to modify locally.
19+
20+
1. If you don't have a workspace yet, you can sign up for one at
21+
[Structurizr](https://structurizr.com/help/getting-started). Once you have a
22+
workspace, take note of its ID, API key, and secret. In order to get started
23+
with creating a new workspace, take a look at [the
24+
examples](https://github.com/Midnighter/structurizr-python/tree/devel/examples).
25+
In particular the
26+
[getting-started](https://github.com/Midnighter/structurizr-python/blob/devel/examples/getting_started.py)
27+
script will be suitable.
28+
29+
The `#!python main()` function in each example script creates a more or less involved
30+
workspace for you. When you have created a workspace, it is time to upload
31+
it so that you can create diagrams for it. You will need to create a
32+
`#!python StructurizrClient` instance and its settings. The settings can be provided
33+
as arguments, be read from environment variables, or be provided in a `.env`
34+
file.
35+
36+
```python
37+
from structurizr import StructurizrClient, StructurizrClientSettings
38+
39+
workspace = main()
40+
settings = StructurizrClientSettings(
41+
workspace_id=1234,
42+
api_key='your api key',
43+
api_secret='your api secret',
44+
)
45+
client = StructurizrClient(settings=settings)
46+
client.put_workspace(workspace)
47+
```
48+
49+
The example should now be available in your online workspace.
50+
51+
2. In case you already have a comprehensive workspace online, the Python client
52+
can help with creating local copies and modifying it.
53+
54+
```python
55+
from structurizr import StructurizrClient, StructurizrClientSettings
56+
57+
settings = StructurizrClientSettings(
58+
workspace_id=1234,
59+
api_key='your api key',
60+
api_secret='your api secret',
61+
)
62+
client = StructurizrClient(settings=settings)
63+
workspace = client.get_workspace()
64+
```
65+
66+
You can then modify the workspace as you please and upload your new version
67+
as shown above.
68+
69+
## Copyright
70+
71+
* Copyright © 2020, Moritz E. Beber.
72+
* Free software distributed under the [Apache Software License
73+
2.0](https://www.apache.org/licenses/LICENSE-2.0).

mkdocs.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ site_name: Structurizr-Python
22
site_description: A Python client package for the Structurizr cloud service and on-premises installation.
33
site_author: Moritz E. Beber
44

5-
nav:
6-
- Home: index.md
7-
- Architecture Descision Records: adr
5+
markdown_extensions:
6+
- pymdownx.highlight
7+
- pymdownx.superfences
8+
- pymdownx.inlinehilite
89

910
theme:
1011
name: material
@@ -17,23 +18,25 @@ theme:
1718
- navigation.instant
1819
icon:
1920
repo: fontawesome/brands/github
21+
2022
plugins:
2123
- search:
2224
prebuild_index: true
25+
- awesome-pages
2326

2427
extra:
2528
social:
2629
- icon: fontawesome/brands/slack
27-
link: 'https://join.slack.com/t/structurizr/shared_invite/enQtMzkyMjY1NzMwNTkzLTcyOGI1MTZmNDQwMDQ5YmZlMThiYmU1ZTM2ZWZiMzYwMjVhNmM0OWIwNjFlZTM1YmY3YzU0ZDY2MTA1YTk5Mjg'
30+
link: https://join.slack.com/t/structurizr/shared_invite/enQtMzkyMjY1NzMwNTkzLTcyOGI1MTZmNDQwMDQ5YmZlMThiYmU1ZTM2ZWZiMzYwMjVhNmM0OWIwNjFlZTM1YmY3YzU0ZDY2MTA1YTk5Mjg
2831
name: Join the Structurizr Slack
2932
- icon: fontawesome/brands/github
30-
link: 'https://github.com/Midnighter'
33+
link: https://github.com/Midnighter
3134
name: Moritz on GitHub
3235
- icon: fontawesome/brands/twitter
33-
link: 'https://twitter.com/me_beber'
36+
link: https://twitter.com/me_beber
3437
name: Moritz on Twitter
3538
- icon: fontawesome/brands/linkedin
36-
link: 'https://www.linkedin.com/in/moritz-beber-b597a55a/'
39+
link: https://www.linkedin.com/in/moritz-beber-b597a55a/
3740
name: Moritz on LinkedIn
3841

3942
copyright: Copyright &copy 2020, Moritz E. Beber.

0 commit comments

Comments
 (0)