CLI for pygraphviz powered by graphviz
Project description
# pygraph
pygraph is an extremely simple CLI tool for using graphviz. It takes a file to write to and
adjacency list to construct the graph from. The intended use case is for generating
small graphs to embed in things like homework problems. The API is documented via the `--help`
option
## Usage
```bash
$ pygraph --help
Usage: pygraph [OPTIONS] FILE EDGES...
Options:
-e, --engine [dot|neato|twopi|circo|fdp|sfdp|patchword|osage]
-u, --undirected / -d, --directed
--format TEXT
--help Show this message and exit.
```
## Syntax
* Pairs of single characters are interpreted as creating an edge between the first and second
* Nodes can have any name when separated by `-` (eg: `root-child`)
* To label the edge, append `:` and any text (eg: `root-child:label`)
* Name the image by passing `-n` option
### Examples
```bash
pygraph -d tree ab ac bd be
```
![tree](examples/tree.png)
```
pygraph -u -e neato circle ab bc cd de ea
```
![circle](examples/circle.png)
```
pygraph -d -n "Sample Tree" labeled-tree root-left:1 root-right:1 left-child:4 right-child:3 root-root:0
```
![labeled-tree](examples/labeled-tree.png)
pygraph is an extremely simple CLI tool for using graphviz. It takes a file to write to and
adjacency list to construct the graph from. The intended use case is for generating
small graphs to embed in things like homework problems. The API is documented via the `--help`
option
## Usage
```bash
$ pygraph --help
Usage: pygraph [OPTIONS] FILE EDGES...
Options:
-e, --engine [dot|neato|twopi|circo|fdp|sfdp|patchword|osage]
-u, --undirected / -d, --directed
--format TEXT
--help Show this message and exit.
```
## Syntax
* Pairs of single characters are interpreted as creating an edge between the first and second
* Nodes can have any name when separated by `-` (eg: `root-child`)
* To label the edge, append `:` and any text (eg: `root-child:label`)
* Name the image by passing `-n` option
### Examples
```bash
pygraph -d tree ab ac bd be
```
![tree](examples/tree.png)
```
pygraph -u -e neato circle ab bc cd de ea
```
![circle](examples/circle.png)
```
pygraph -d -n "Sample Tree" labeled-tree root-left:1 root-right:1 left-child:4 right-child:3 root-root:0
```
![labeled-tree](examples/labeled-tree.png)
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
pygraph-cli-0.0.0.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for pygraph_cli-0.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 825b9e871035c1d41c278e6eb9f2ed72a562c8bcf87284e0f66a31705828f8d9 |
|
MD5 | 2a58f589fb040638edbd2fc5502584e4 |
|
BLAKE2b-256 | 9976ae56922f2bae88df5216a2a1803c9c1eb268f9bb809b47f733008311c866 |