Skip to main content

Create infrastructure diagrams from configuration files (YAML and JSON) by using Graphviz

Project description

infrastructure-diagrams is a python package that allows creating infrastructure diagrams/graphs from configuration files (YAML and JSON). The package utilizes Graphviz to generate the diagrams. The functionality is exposed in the command line by the Unix command file.


The package requires python >= 3.6. It has only been tested on Linux as the intended use was for automatically generating diagrams in a CI.


The current stable version of infrastructure-daigrams is available on pypi and can be installed by running pip install infrastructure-diagrams.

Other sources:


$ infrastructure-diagrams
usage: infrastructure-diagrams [-h] [-d DISPLAY] [-o OUTPUT] [-r RENDERER] file

positional arguments:
  file                  path to diagram file

optional arguments:
  -h, --help            show this help message and exit
  -d DISPLAY, --display DISPLAY
                        display the diagram after rendering
  -o OUTPUT, --output OUTPUT
                        output path for the diagram, including filetype (.svg, .png, etc.)
  -r RENDERER, --renderer RENDERER
                        output renderer used for rendering (cairo, gd, etc.)

Example: $ infrastructure-diagrams -o example.png examples/example.yaml

Configuration files

The configuration files extend the Graphviz Node, Edge and Graph Attributes, meaning you can customize the diagram / graph as needed.

Example, misc.yaml from the examples/ directory:

  fontsize: 20
  label: Simple Diagram
graph_engine: dot
  - id: group1
    label: "Group (ID: 1)"
    style: filled
    fillcolor: "#cccccc"
      # Group 1 node 1
      - id: g1_node1
        label: Node G1_1
          - node: G2_1
            label: Edge between node G1_1 and G2_1
            color: brown
            fontcolor: brown
          - node: global_node_1
            label: Edge between node G1_1 and global_node_1
  - id: group2
    parent_group: group1
    label: "Group (ID: 2)"
    style: filled
    fillcolor: "#aaaaaa"
    color: purple
      # Group 2 node 1
      - id: G2_1
        label: Node G2_1
        style: filled
        fillcolor: "#0026ca:#7a7cff"
        fontcolor: white
      - id: G2_2
        label: Node G2_2
        shape: box
        color: green
          - node: G2_1
      - id: G2_3
        label: Node G2_3
          - node: global_node_2
            label: Edge between node G2_3 and global_node_2
            color: red
  - id: global_node_1
    label: Global Node 1
      - node: global_node_2
        label: Edge between Global node 1 and 2
  - id: global_node_2
    label: Global Node 2
    shape: star

Output: Output of misc.yaml

Example diagram configuration files can be found under the examples/ directory.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for infrastructure-diagrams, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size infrastructure_diagrams-0.0.2-py3-none-any.whl (9.0 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size infrastructure-diagrams-0.0.2.tar.gz (5.8 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page