Allows Python code execution inside of graphviz diagrams.
Project description
graphviz-py
Allows Python code execution inside of graphviz diagrams
Example
graph python_graph {
{{
import math
value = 0.5
sin = math.sin(value)
cos = math.cos(value)
}}
A [label="{{= value }}"];
B [label="{{= sin }}"];
C [label="{{= cos }}"];
A -- B [headlabel="sin"];
A -- C [headlabel="cos"];
}
Output
Installation
pip install graphviz-py
Important: Make sure graphviz is installed! See graphviz installation instructions.
Usage
Using files
graphviz-py -Tsvg example/example.py.dot -o output.svg
graphviz-py -Tpng example/example.py.dot -o output.png
Using stdin / pipes
echo 'digraph { A -> B [label="{{= 38 * 73 }}"] }' | graphviz-py -Tsvg > output.svg
graphviz-py passes all unknown arguments to graphviz. So you can use all graphviz arguments.
Coming soon
- Compartibility with asciidoctor-diagram
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
graphviz-py-1.0.2.tar.gz
(8.7 kB
view hashes)
Built Distribution
Close
Hashes for graphviz_py-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82845dab39644139c1cf82c3f501b31bf1a8b93e258d7dbaaf301994b518fa72 |
|
MD5 | 4c1f47f7152a3d966f2f1bdb24aef5c6 |
|
BLAKE2b-256 | 2c7b5e8d9b9116a1bc641c98509d57737a424bb395b8d1a8088e88026b58cb4d |