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
Install
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.1.tar.gz
(8.7 kB
view details)
Built Distribution
File details
Details for the file graphviz-py-1.0.1.tar.gz
.
File metadata
- Download URL: graphviz-py-1.0.1.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.10.2 Linux/5.11.0-1028-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72fba239f5ce2b97064fa44d1699dcd8ee468d844eed65b9090e06fc89a5ea53 |
|
MD5 | a070849a0071f7c9fcd43ac8937e6789 |
|
BLAKE2b-256 | 26721497a9407c7fbd4d20b45d4443abfd44c85fd9cd8d0fea2c63a79fb9ce36 |
File details
Details for the file graphviz_py-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: graphviz_py-1.0.1-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.10.2 Linux/5.11.0-1028-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 916754a023f407d10897c22c0e642715891498ac2c4efd441080c6ba8af4f366 |
|
MD5 | bc662fc6e197f76e38abae4e4a84539a |
|
BLAKE2b-256 | 45242ccc517487d579672ca7fde2e146a4c0fceeffe1d75f5fc0149aa31e1165 |