Skip to main content

graph-easy

PyPI version Downloads

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: -- solid, .. dotted, == double, ~~ wave, ## bold, .-/..- dot-dash
  • Edge labels float next to the line (truncated to fit); label-pos can place them above (default) or below; --autolabel tags unlabelled edges as source -> target
  • Two output charsets: Unicode box-drawing by default, plain ASCII via --ascii
  • Colours: fill/color, border-color, and a ColourBrewer palette via color: <n>; scheme: <name>; accepts named colours, #RGB/#RRGGBB true-colour, or a palette index
  • Node shapes: normal/box, rounded/ellipse/circle/oval, diamond, hexagon
  • Edge arrows: arrow-style: plain|open|line (ASCII heads) vs filled
  • Text style: text-style: bold|italic|underline|strike
  • Graphviz export: --dot emits DOT; --format svg|png uses dot

Limitations: labels clip to free space beside an edge; very dense graphs may need manual attribute tuning. The heavier 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.2

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.1.2
File Size Uploaded Provenance
graph_easy-0.1.2.tar.gz 38.9 kB With provenance Details

Built distribution (wheel)

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

Total release size: 71.0 kB

Release files / graph_easy-0.1.2.tar.gz

Download URL graph_easy-0.1.2.tar.gz
Size 38.9 kB
Tags Source
SHA-256 checksum
How to use checksums
482ea77cb020451f6984d454d695443b36b91493a26f1b665486dcc76acc101c
BLAKE2b-256 checksum
How to use checksums
5647df1ad84c5e8a68dced9e098587bf699bcc94054b96562333dfb133142255
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.1.2-py3-none-any.whl

Download URL graph_easy-0.1.2-py3-none-any.whl
Size 32.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8d41f95b234ea4a996521a065f51630658d958e460326b7ac70ba271a1550080
BLAKE2b-256 checksum
How to use checksums
85f21964e6c6ea9ccab3cc4c96086889644d4e1a7c0f4aa03bcc04ef4d8850bf
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.1.2

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