Skip to main content

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: fill/color attributes map to ANSI codes (on by default, --no-color / --color auto to control)

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.0.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for graph-easy 0.0.10
File Size Uploaded Provenance
graph_easy-0.0.10.tar.gz 32.2 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for graph-easy 0.0.10
File Interpreter ABI Platform
graph_easy-0.0.10-py3-none-any.whl Python 3 none any Details

Total release size: 58.8 kB

Release files / graph_easy-0.0.10.tar.gz

Download URL graph_easy-0.0.10.tar.gz
Size 32.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8ba0bc5cf08e13ef5d42a968c41c64702593d7652417f4fe4d7782a6ddf0e7f5
BLAKE2b-256 checksum
How to use checksums
1b61262352989ac09a51c0507c40126dfeede63ce7901fe535f27845f4118eba
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 log

Release files / graph_easy-0.0.10-py3-none-any.whl

Download URL graph_easy-0.0.10-py3-none-any.whl
Size 26.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
830377a35bcdbc2bb98e26e5272aa57eea5b60435eaabd3eeeb5fc2a32d3fe9b
BLAKE2b-256 checksum
How to use checksums
9249018e9a5f338397da887fb4d4903e9c8fa888f8eae576bc57799604cbb4be
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 log

Security for graph-easy 0.0.10

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.

Select from 2 files

Attestation for graph_easy-0.0.10.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 log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page