Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mujahidk/python-diagrams
Diagrams as code using Python and Diagrams
https://github.com/mujahidk/python-diagrams
diagrams docker graphviz python
Last synced: 2 months ago
JSON representation
Diagrams as code using Python and Diagrams
- Host: GitHub
- URL: https://github.com/mujahidk/python-diagrams
- Owner: mujahidk
- License: mit
- Created: 2020-04-27T19:34:58.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-07-06T15:11:39.000Z (over 4 years ago)
- Last Synced: 2023-03-01T15:02:24.577Z (almost 2 years ago)
- Topics: diagrams, docker, graphviz, python
- Language: Dockerfile
- Homepage: https://hub.docker.com/r/mjdk/diagrams
- Size: 43.9 KB
- Stars: 2
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# python-diagrams
Diagrams as code using Python and Diagrams
## Docker image
- Update apt
- Install graphviz - Diagrams requirement
- Install diagrams## Create diagram using container
### Sample script
> **hello-world.py**
```python
from diagrams import Diagram
from diagrams.aws.compute import EC2
from diagrams.aws.database import RDS
from diagrams.aws.network import ELBwith Diagram("Hello World", show=False):
ELB("Load Balancer") >> EC2("Message Server") >> RDS("Message Store")
```### Run script using container
```bash
docker run -it --rm -v "$PWD":/diagrams/scripts/ -w /diagrams/scripts/ mjdk/diagrams hello-world.py
```### View generated diagram in the scripts directory
![Hello, World](https://raw.githubusercontent.com/mujahidk/python-diagrams/master/scripts/hello_world.png)
## Read more
- [Diagrams](https://diagrams.mingrammer.com/)
- [Diagrams Python - GitHub](https://github.com/mingrammer/diagrams)## License
[MIT](https://github.com/mujahidk/python-diagrams/blob/master/LICENSE)