Skip to main content

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

## Examples
```bash
pygraph -d tree ab ac bd be

pygraph -u -e neato circle ab bc cd de ea

pygraph -d -n "Sample Tree" labeled-tree root-left:1 root-right:1 left-child:4 right-child:3 root-root:0
```

![tree](examples/tree.png)
![circle](examples/circle.png)
![labeled-tree](examples/labeled-tree.png)

## Usage
```bash
$ pygraph --help
Usage: pygraph [OPTIONS] FILE EDGES...

Options:
-e, --engine [dot|neato|twopi|circo|fdp|sfdp|patchword|osage]
Choose layout engine to use
-u, --undirected / -d, --directed
Specify undirected or directed edges
--format TEXT Image format
-n, --name TEXT Name of graph in image
--dot Preserve the source dot file
--no-vertex-labels Don't label vertex labels
--help Show this message and exit.
```

### Installation
```bash
pip install pygraph-cli
```

### Syntax
* First argument is file to save to without extension
* Pairs of single characters after are interpreted as creating an edge between the them (eg: `ab ac cd`)
* 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
* To keep the original dot source, pass `--dot`

Project details


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.1.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pygraph_cli-0.1.0-py2.py3-none-any.whl (3.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pygraph-cli-0.1.0.tar.gz.

File metadata

  • Download URL: pygraph-cli-0.1.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pygraph-cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8cf60bd78831494a38eb5b493978a1620ef819abd7bdb748008f14ddd8697957
MD5 6d135ddb9fc398b08a630e66669b789c
BLAKE2b-256 a16cbd6293b7edf8b51229c87c2972bda7a2027921ab4216bf309a3efd3743d4

See more details on using hashes here.

File details

Details for the file pygraph_cli-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pygraph_cli-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0b5be49988cacfd237af594bb2fa6e451e862feefe756dcdcff22a9ff48c6a87
MD5 73ecc28c5383ef3222e9599e14067d0f
BLAKE2b-256 582ddda3452b22092ee020318868a73cd9b38313b9f2f6769e5186097fc6619b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page