Skip to main content

使用 Graphviz 从配置文件(YAML 和 JSON)创建基础架构图

项目描述

基础架构图

Infrastructure-diagrams 是一个 python 包,允许从配置文件(YAML 和 JSON)创建基础结构图/图形。该包使用Graphviz <https://www.graphviz.org/>__ 来生成图表。该功能通过 Unix 命令文件在命令行中公开。

注意:某些功能目前未记录在案。

要求

该软件包需要python >= 3.6. 它仅在 Linux 上进行了测试,因为预期用途是在 CI 中自动生成图表。

安装

pypi 上提供了当前稳定版本的基础设施-daigrams,可以通过运行 pip install infrastructure-diagrams.

其他来源:

用法

.. 代码:: 重击

$ 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.)

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

配置文件

配置文件扩展了 Graphviz Node, Edge and Graph Attributes <https://www.graphviz.org/doc/info/attrs.html>__,这意味着您可以根据需要自定义图表/图形。

例子:

  • example.yaml|example.yaml 的输出|

  • misc.yaml|misc.yaml 的输出|

  • iot.yaml|iot.yaml 的输出|

示例图表配置文件可以在 examples/ <https://github.com/kotlarz/infrastructure-diagrams/>__ 目录下找到。

.. |example.yaml 的输出| 图片:: https://raw.githubusercontent.com/kotlarz/infrastructure-diagrams/master/examples/example.png .. |misc.yaml 的输出| 图片:: https://raw.githubusercontent.com/kotlarz/infrastructure-diagrams/master/examples/misc.png .. |iot.yaml 的输出| 图片:: https://raw.githubusercontent.com/kotlarz/infrastructure-diagrams/master/examples/iot.png

下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

Infrastructure-diagrams-0.0.6.tar.gz (8.4 kB 查看哈希

已上传 source

内置分布

Infrastructure_diagrams-0.0.6-py3-none-any.whl (9.2 kB 查看哈希

已上传 py3