graph-easy
A Python port of Graph::Easy, the Perl tool that lays out directed/undirected graphs and renders them as ASCII art (box-and-wire diagrams rendered in the terminal).
This project faithfully translates the original Perl implementation to Python, in order to provide the same functionality to Python users / as a native Python library and command-line tool.
Provenance & License
- Original: Graph::Easy, Copyright (C) 2004 - 2008 by Tels (http://bloodgate.com/).
- Upstream repository: https://github.com/ironcamel/Graph-Easy
- This port is licensed under the GNU General Public License, version 2 or (at your option) any later version — the same license as the original Graph::Easy, because a port is a derivative work.
See LICENSE for the full LGPL/ GPL text.
Third-party color schemes
This product includes color specifications and designs developed by Cynthia
Brewer (http://colorbrewer.org/), used under the
Apache-Style Software License for ColorBrewer Color Schemes v1.1,
© 2002 Cynthia Brewer, Mark Harrower, and The Pennsylvania State University.
See the header of the original Graph::Easy::Attributes for the full notice.
Status
Actively-developed port. Currently implemented:
- DSL parser:
[ label ]/bare nodes,--><--<-->--arrows, labelled edges (-- label -->), multiline labels (\n), comments - Layout engine: longest-path layering with orthogonal edge routing — chains, branches, merges and cycles all render correctly; independent components stack as separate diagrams
- Edge line styles (faithful to upstream
Parser::_edge_style):--solid,..dotted,==double,~~wave,##bold,.-/..-dot-dash - Two output charsets: Unicode box-drawing by default
(
┌──┐ ──> ══ ║ ·), plain ASCII via--ascii
The heavier automatic layout engine (Graph::Easy::Layout grid solver) is a
follow-up milestone.
Usage
$ printf '[ Bonn ] --> [ Berlin ] --> [ Hamburg ]\n' | graph-easy
┌──────┐ ┌────────┐ ┌─────────┐
│ Bonn │ ───────>│ Berlin │ ───────>│ Hamburg │
└──────┘ └────────┘ └─────────┘
# plain-ASCII output
$ printf '[ A ] ..> [ B ]\n' | graph-easy --ascii
+---+ +---+
| A | .......>| B |
+---+ +---+
Development
$ python -m venv .venv && source .venv/bin/activate
$ pip install -e '.[dev]'
$ pytest
Acknowledgments
Thanks to Tels and the Graph::Easy contributors whose careful layout and rendering work this port builds upon.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file graph_easy-0.0.1.tar.gz.
File metadata
- Download URL: graph_easy-0.0.1.tar.gz
- Upload date:
- Size: 20.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
420fe96ca5a2fe24fd8b95e20fe6a6c086d92e79b58d75f86f9620481e87014d
|
|
| MD5 |
4d0a19cf43b70a475f17997caf3d1916
|
|
| BLAKE2b-256 |
16cf05109a67077e9a6b63d759d43cd154714adf69722841cae23e906bedea8a
|
Provenance
The following attestation bundles were made for graph_easy-0.0.1.tar.gz:
Publisher:
publish.yml on y9c/graph-easy-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
graph_easy-0.0.1.tar.gz -
Subject digest:
420fe96ca5a2fe24fd8b95e20fe6a6c086d92e79b58d75f86f9620481e87014d - Sigstore transparency entry: 2464773429
- Sigstore integration time:
-
Permalink:
y9c/graph-easy-py@0f715932316e92c46180439f882fc057b7dc99f8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/y9c
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0f715932316e92c46180439f882fc057b7dc99f8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file graph_easy-0.0.1-py3-none-any.whl.
File metadata
- Download URL: graph_easy-0.0.1-py3-none-any.whl
- Upload date:
- Size: 18.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7a0abfddc6bb52814d1230b355a3a5765bbd4127019f0279f9546622bbc43fe
|
|
| MD5 |
61a48e81e9f60ed4f00d5b0340493665
|
|
| BLAKE2b-256 |
31eb31388dd9a99e7189efd7ec4fc4939727ab8285fb584548611694c2e02ffc
|
Provenance
The following attestation bundles were made for graph_easy-0.0.1-py3-none-any.whl:
Publisher:
publish.yml on y9c/graph-easy-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
graph_easy-0.0.1-py3-none-any.whl -
Subject digest:
e7a0abfddc6bb52814d1230b355a3a5765bbd4127019f0279f9546622bbc43fe - Sigstore transparency entry: 2464773945
- Sigstore integration time:
-
Permalink:
y9c/graph-easy-py@0f715932316e92c46180439f882fc057b7dc99f8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/y9c
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0f715932316e92c46180439f882fc057b7dc99f8 -
Trigger Event:
push
-
Statement type: