`Diagrams as code`: declarative configurations using `YAML` for drawing cloud system architectures.
[](https://github.com/dmytrostriletskyi/diagrams-yaml/actions/workflows/main.yaml)
[](https://github.com/dmytrostriletskyi/diagrams-yaml/releases)
[](https://pypi.python.org/pypi/diagrams-yaml)
[](https://pypi.python.org/pypi/diagrams-yaml/)
[](https://pypi.python.org/pypi/diagrams-yaml/)

Table of content:
* [Introduction](#introduction)
* [Roadmap](#roadmap)
* [Getting Started](#getting-started)
* [How to Install](#how-to-install)
* [Examples](#examples)
* [Syntax Highlighting](#syntax-highlighting)
* [PyCharm](#pycharm)
* [Usage](#usage)
* [Command Line Interface](#command-line-interface)
* [Disclaimer](#disclaimer)
## Introduction
`Diagrams as code` is essentially the process of managing diagrams through code rather than interactively drawing them
on specific web services such as [draw.io](https://app.diagrams.net). It lets you generate the cloud system architecture
in a **declarative** way with widely used `YAML` syntax (which is de facto a standard for infrastructure and
configurations).
Declarative method of describing things means that a user simply describes the solution they need, how it should look,
and everything that would be in the state of the final solution, leaving the process for the software to decide.
`Diagrams as code` brings you the following benefits comparing to drawing architecture on your own, it:
* Does not require any knowledge about how to properly draw an architecture diagram. Basically, you just define a set of
resources, compose them into groups and set relationships, the rest is done for you.
* Allows you to track an architecture diagram changes with a version control systems such as `Git`.
* Moves collaboration to the next level: updating an architecture diagram through a pull request with a code review
instead of a video session and/or screen sharing.
* Reduces costs on further updating of an initial architecture diagram. Basically, when you create an image on a web
service you have to eventually store two files: `PNG`-like to put into your documentation and `XML` to be able to
adjust your image in the future. So, there is no need to care about `XML` anymore.
* Backups you in case of losing `XML` files as `YAML` files are always stored in a repository.
* Improves consistency as now a diagram is stored along the code in a repository, the place you visit and work on
frequently, and it is easier to keep it up-to-date.
Currently, the following components are provided:
* Major cloud providers: AWS, Azure, GCP, IBM, Alibaba, Oracle, OpenStack, DigitalOcean and so on.
* On-Premise, Kubernetes, Firebase, Elastic, SaaS.
* Programming languages and frameworks.
## Roadmap
* Add support of [C4](https://diagrams.mingrammer.com/docs/nodes/c4).
* Add support of [Custom](https://diagrams.mingrammer.com/docs/nodes/custom).
* Add IDEs plugins and/or web user interface for live editing.
* Research Confluence integration to update images from the CI-builds directly.
* Research ChatGRT integration.
## Getting Started
### How to install
As the project uses [Graphviz](https://www.graphviz.org) to render the diagram, you need to install it:
* For `Linux` — https://graphviz.gitlab.io/download/#linux
* For `Windows` — https://graphviz.gitlab.io/download/#windows
* For `macOS` — https://graphviz.gitlab.io/download/#mac
After, you can install the project itself with the following command using `pip3`:
```bash
$ pip3 install diagrams-yaml
```
### Examples
You can find examples of `YAML` configurations in the [examples](https://github.com/dmytrostriletskyi/diagrams-yaml/tree/main/examples)
folder. Below are placed are few of them (click on the name to redirect to the configurations file).
| [Web Services on AWS](https://github.com/dmytrostriletskyi/diagrams-yaml/blob/main/examples/web-services-aws.yaml) | [Web Services On-Premise](https://github.com/dmytrostriletskyi/diagrams-yaml/blob/main/examples/web-services-on-premise.yaml) | [Exposed Pods on Kubernetes](https://github.com/dmytrostriletskyi/diagrams-yaml/blob/main/examples/exposed-pods-kubernetes.yaml) |
|-----------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|
|  |  |  |
| [Message Collecting on GCP](https://github.com/dmytrostriletskyi/diagrams-yaml/blob/main/examples/message-collecting-gcp.yaml) | [Events Processing on AWS](https://github.com/dmytrostriletskyi/diagrams-yaml/blob/main/examples/events-processing-aws.yaml) | [Workers on AWS](https://github.com/dmytrostriletskyi/diagrams-yaml/blob/main/examples/workers-aws.yaml) |
| --------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
|  |  |  |
### Syntax Highlighting
When you will be writing your own `YAML` files, you likely need a syntax highlighting. Currently, there is no mapping
of the `YAML` files to a specific schema to enable the syntax highlighting automatically. So, there is a need for
manual operation here.
#### PyCharm
For `PyCharm`, open the settings and proceed to `Languages & Framworks`, then to `Scheams and DTDs`, then to
`JSON Schema Mappings`. After, create a new schema, name it `Diagrams as code`, choose
`JSON Schema version 7`, paste `https://raw.githubusercontent.com/dmytrostriletskyi/diagrams-yaml/main/json-schemas/0.0.1.json`
to the `Schema file or URL` field and click `Apply`:
<details>
<summary>Open Illustration</summary>

</details>
Right after then, open a `YAML` file and click on `No JSON schema` at to bottom-right corner:
<details>
<summary>Open Illustration</summary>

</details>
It will open a panel where you can choose the newly created schema with name `Diagrams as code`:
<details>
<summary>Open Illustration</summary>

</details>
As the result, you will experience the syntax highlighting when typing:
<details>
<summary>Open Illustration</summary>

</details>
## Usage
### Command Line Interface
To draw an architecture, call `diagrams-yaml` command line interface, providing a path to a `YAML` file with
configurations. The drawing will be saved in the folder the command line interface was executed from.
```bash
$ diagrams-yaml examples/web-services-aws.yaml
```
## Disclaimer
`diagrams-yaml` is a wrapper around original [diagrams](https://github.com/mingrammer/diagrams). The original `diagrams`
lets you draw the cloud system architecture in `Python` code. It was born for prototyping a new system architecture
design without any design tools. Under the hood, `diagrams-yaml` parse a `YAML` file and map to specific set of
`diagrams`'s functions and classes, and executes them in proper order.
But you don't have to worry about `diagrams` because `diagrams-yaml` is self-contained and encapsulates it well.
Raw data
{
"_id": null,
"home_page": "https://github.com/dmytrostriletskyi/diagrams-yaml",
"name": "diagrams-yaml",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Dmytro Striletskyi",
"author_email": "dmytro.striletskyi@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/69/1a/af8211ff06393d4de5173a48d9b4d4a0dada5a87c409e88e0ad7c2a2c67f/diagrams-yaml-0.0.18.tar.gz",
"platform": null,
"description": "`Diagrams as code`: declarative configurations using `YAML` for drawing cloud system architectures.\n\n[](https://github.com/dmytrostriletskyi/diagrams-yaml/actions/workflows/main.yaml)\n[](https://github.com/dmytrostriletskyi/diagrams-yaml/releases)\n[](https://pypi.python.org/pypi/diagrams-yaml)\n[](https://pypi.python.org/pypi/diagrams-yaml/)\n[](https://pypi.python.org/pypi/diagrams-yaml/)\n\n\n\nTable of content:\n\n* [Introduction](#introduction)\n* [Roadmap](#roadmap)\n* [Getting Started](#getting-started)\n * [How to Install](#how-to-install)\n * [Examples](#examples)\n * [Syntax Highlighting](#syntax-highlighting)\n * [PyCharm](#pycharm)\n* [Usage](#usage)\n * [Command Line Interface](#command-line-interface)\n* [Disclaimer](#disclaimer)\n\n## Introduction\n\n`Diagrams as code` is essentially the process of managing diagrams through code rather than interactively drawing them\non specific web services such as [draw.io](https://app.diagrams.net). It lets you generate the cloud system architecture\nin a **declarative** way with widely used `YAML` syntax (which is de facto a standard for infrastructure and \nconfigurations).\n\nDeclarative method of describing things means that a user simply describes the solution they need, how it should look, \nand everything that would be in the state of the final solution, leaving the process for the software to decide.\n\n`Diagrams as code` brings you the following benefits comparing to drawing architecture on your own, it:\n\n* Does not require any knowledge about how to properly draw an architecture diagram. Basically, you just define a set of \n resources, compose them into groups and set relationships, the rest is done for you.\n* Allows you to track an architecture diagram changes with a version control systems such as `Git`.\n* Moves collaboration to the next level: updating an architecture diagram through a pull request with a code review \n instead of a video session and/or screen sharing.\n* Reduces costs on further updating of an initial architecture diagram. Basically, when you create an image on a web \n service you have to eventually store two files: `PNG`-like to put into your documentation and `XML` to be able to \n adjust your image in the future. So, there is no need to care about `XML` anymore.\n* Backups you in case of losing `XML` files as `YAML` files are always stored in a repository.\n* Improves consistency as now a diagram is stored along the code in a repository, the place you visit and work on\n frequently, and it is easier to keep it up-to-date.\n\nCurrently, the following components are provided:\n\n* Major cloud providers: AWS, Azure, GCP, IBM, Alibaba, Oracle, OpenStack, DigitalOcean and so on.\n* On-Premise, Kubernetes, Firebase, Elastic, SaaS.\n* Programming languages and frameworks.\n\n## Roadmap\n\n* Add support of [C4](https://diagrams.mingrammer.com/docs/nodes/c4).\n* Add support of [Custom](https://diagrams.mingrammer.com/docs/nodes/custom).\n* Add IDEs plugins and/or web user interface for live editing.\n* Research Confluence integration to update images from the CI-builds directly.\n* Research ChatGRT integration.\n\n## Getting Started\n\n### How to install\n\nAs the project uses [Graphviz](https://www.graphviz.org) to render the diagram, you need to install it:\n\n* For `Linux` \u2014 https://graphviz.gitlab.io/download/#linux\n* For `Windows` \u2014 https://graphviz.gitlab.io/download/#windows\n* For `macOS` \u2014 https://graphviz.gitlab.io/download/#mac\n\nAfter, you can install the project itself with the following command using `pip3`:\n\n```bash\n$ pip3 install diagrams-yaml\n```\n\n### Examples\n\nYou can find examples of `YAML` configurations in the [examples](https://github.com/dmytrostriletskyi/diagrams-yaml/tree/main/examples) \nfolder. Below are placed are few of them (click on the name to redirect to the configurations file).\n\n| [Web Services on AWS](https://github.com/dmytrostriletskyi/diagrams-yaml/blob/main/examples/web-services-aws.yaml) | [Web Services On-Premise](https://github.com/dmytrostriletskyi/diagrams-yaml/blob/main/examples/web-services-on-premise.yaml) | [Exposed Pods on Kubernetes](https://github.com/dmytrostriletskyi/diagrams-yaml/blob/main/examples/exposed-pods-kubernetes.yaml) |\n|-----------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|\n|  |  |  |\n\n| [Message Collecting on GCP](https://github.com/dmytrostriletskyi/diagrams-yaml/blob/main/examples/message-collecting-gcp.yaml) | [Events Processing on AWS](https://github.com/dmytrostriletskyi/diagrams-yaml/blob/main/examples/events-processing-aws.yaml) | [Workers on AWS](https://github.com/dmytrostriletskyi/diagrams-yaml/blob/main/examples/workers-aws.yaml) |\n| --------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |\n|  |  |  |\n\n### Syntax Highlighting\n\nWhen you will be writing your own `YAML` files, you likely need a syntax highlighting. Currently, there is no mapping\nof the `YAML` files to a specific schema to enable the syntax highlighting automatically. So, there is a need for\nmanual operation here.\n\n#### PyCharm\n\nFor `PyCharm`, open the settings and proceed to `Languages & Framworks`, then to `Scheams and DTDs`, then to\n`JSON Schema Mappings`. After, create a new schema, name it `Diagrams as code`, choose\n`JSON Schema version 7`, paste `https://raw.githubusercontent.com/dmytrostriletskyi/diagrams-yaml/main/json-schemas/0.0.1.json`\nto the `Schema file or URL` field and click `Apply`:\n\n<details>\n <summary>Open Illustration</summary>\n\n \n</details>\n\nRight after then, open a `YAML` file and click on `No JSON schema` at to bottom-right corner:\n\n<details>\n <summary>Open Illustration</summary>\n\n \n</details>\n\nIt will open a panel where you can choose the newly created schema with name `Diagrams as code`:\n\n<details>\n <summary>Open Illustration</summary>\n\n \n</details>\n\nAs the result, you will experience the syntax highlighting when typing:\n\n<details>\n <summary>Open Illustration</summary>\n\n \n</details>\n\n## Usage\n\n### Command Line Interface\n\nTo draw an architecture, call `diagrams-yaml` command line interface, providing a path to a `YAML` file with \nconfigurations. The drawing will be saved in the folder the command line interface was executed from.\n\n```bash\n$ diagrams-yaml examples/web-services-aws.yaml\n```\n\n## Disclaimer\n\n`diagrams-yaml` is a wrapper around original [diagrams](https://github.com/mingrammer/diagrams). The original `diagrams` \nlets you draw the cloud system architecture in `Python` code. It was born for prototyping a new system architecture \ndesign without any design tools. Under the hood, `diagrams-yaml` parse a `YAML` file and map to specific set of \n`diagrams`'s functions and classes, and executes them in proper order.\n\nBut you don't have to worry about `diagrams` because `diagrams-yaml` is self-contained and encapsulates it well. \n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Diagrams as code: declarative configurations using YAML for drawing cloud system architectures.",
"version": "0.0.18",
"project_urls": {
"Download": "https://github.com/dmytrostriletskyi/diagrams-yaml/tags",
"Homepage": "https://github.com/dmytrostriletskyi/diagrams-yaml",
"Issue Tracker": "https://github.com/dmytrostriletskyi/diagrams-yaml/issues",
"Source Code": "https://github.com/dmytrostriletskyi/diagrams-yaml"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "691aaf8211ff06393d4de5173a48d9b4d4a0dada5a87c409e88e0ad7c2a2c67f",
"md5": "4711d5d6999775b6b1f098e5d31c9e43",
"sha256": "ca0726b51d353951073843fbe014817eb36ebda2a71efc69cc929fd8b007343f"
},
"downloads": -1,
"filename": "diagrams-yaml-0.0.18.tar.gz",
"has_sig": false,
"md5_digest": "4711d5d6999775b6b1f098e5d31c9e43",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 11904,
"upload_time": "2023-07-25T13:18:01",
"upload_time_iso_8601": "2023-07-25T13:18:01.252589Z",
"url": "https://files.pythonhosted.org/packages/69/1a/af8211ff06393d4de5173a48d9b4d4a0dada5a87c409e88e0ad7c2a2c67f/diagrams-yaml-0.0.18.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-25 13:18:01",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dmytrostriletskyi",
"github_project": "diagrams-yaml",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "diagrams-yaml"
}