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 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 -->and-- { label: x; } -->), multiline labels (\n), node attribute blocks ({ shape: diamond; }), groups (( name [ A ] --> [ B ] )), comments - Layout engine: longest-path layering with barycenter reordering and orthogonal edge routing — chains, branches, merges, layer-spanning edges, back edges (cycles) and self-loops all render without clobbering boxes (long edges are routed through detour rows); independent components stack as separate diagrams
- Edge line styles (faithful to upstream
Parser::_edge_style):--solid,..dotted,==double,~~wave,##bold,.-/..-dot-dash - Edge labels float in the box-free region next to the line (truncated to fit)
- Two output charsets: Unicode box-drawing by default
(
┌──┐ ──▶ ══ ║ ·), plain ASCII via--ascii - Colours (on by default;
--no-color/--color autoto control):fill(background) andcolor(foreground) for the label,border-colorfor the frame, and a ColourBrewer palette viacolor: <n>; scheme: <name>. Values accept named colours,#RGB/#RRGGBBtrue-colour, or a palette index (e.g.color: 3; scheme: blues5). - Node shapes:
normal/box(rectangle),rounded/ellipse/circle/oval,diamond, andhexagon, set viashape: <name>. - Graphviz export:
--dot(or--format dot) emits Graphviz DOT;--format svg|pngrenders via thedotbinary when available.
Limitations: labels are clipped to the free space beside an edge; very dense
graphs may need manual attribute tuning. 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 │
└──────┘ └────────┘ └─────────┘
Colours from fill/color attributes are on by default; use
--no-color to disable, or --color auto to enable only on a TTY.
# 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]'
$ ruff check .
$ mypy src
$ pytest
Acknowledgments
Thanks to Tels and the Graph::Easy contributors whose careful layout and rendering work this port builds upon.
Metadata
Release files for graph-easy 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| graph_easy-0.1.0.tar.gz | 38.3 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| graph_easy-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 70.2 kB
Release files / graph_easy-0.1.0.tar.gz
| Download URL | graph_easy-0.1.0.tar.gz |
|---|---|
| Size | 38.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1b51f0452330b9dc5e06f8d8164ae78405caad8ab88314dbf38218c544fc7c8f
|
|
BLAKE2b-256 checksum How to use checksums |
010040347c726223369a22f7461bfdf6358233e2f42d75dc9aa99ac426ff5bb2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.
Transparency logRelease files / graph_easy-0.1.0-py3-none-any.whl
| Download URL | graph_easy-0.1.0-py3-none-any.whl |
|---|---|
| Size | 31.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b00fb70e4c87c444a1a3d19bce047b17adb5982a20a406333ec99e0cd2f705df
|
|
BLAKE2b-256 checksum How to use checksums |
c30f8a158e1a7247faa7ae538a6ab23c80f1c9c2c0a051b63902addeccfe9ad0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.
Transparency logSecurity for graph-easy 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for graph_easy-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.