graphtty

0.1.8 · active · verified Thu Apr 16

graphtty is a Python library that transforms any directed graph into colored ASCII art, designed for display in your terminal. It is a pure Python solution with zero external dependencies. The library is currently at version 0.1.8 and is actively maintained by UiPath, requiring Python 3.11 or newer.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to define a simple directed graph with nodes and edges, then render it as ASCII art in your terminal using `graphtty.render`.

from graphtty import render

graph = {
    "nodes": [
        {"id": "start", "name": "Initialize"},
        {"id": "step1", "name": "Process Data", "description": "Extract, Transform"},
        {"id": "step2", "name": "Analyze Results", "description": "Apply ML Model"},
        {"id": "end", "name": "Final Output"}
    ],
    "edges": [
        {"source": "start", "target": "step1"},
        {"source": "step1", "target": "step2"},
        {"source": "step2", "target": "end"}
    ]
}

ascii_art = render(graph)
print(ascii_art)

view raw JSON →