{"id":7279,"library":"graphtty","title":"graphtty","description":"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.","status":"active","version":"0.1.8","language":"en","source_language":"en","source_url":"https://github.com/uipath/graphtty","tags":["graph","ascii art","terminal","visualization","cli","directed graph","uipath"],"install":[{"cmd":"pip install graphtty","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"symbol":"render","correct":"from graphtty import render"}],"quickstart":{"code":"from graphtty import render\n\ngraph = {\n    \"nodes\": [\n        {\"id\": \"start\", \"name\": \"Initialize\"},\n        {\"id\": \"step1\", \"name\": \"Process Data\", \"description\": \"Extract, Transform\"},\n        {\"id\": \"step2\", \"name\": \"Analyze Results\", \"description\": \"Apply ML Model\"},\n        {\"id\": \"end\", \"name\": \"Final Output\"}\n    ],\n    \"edges\": [\n        {\"source\": \"start\", \"target\": \"step1\"},\n        {\"source\": \"step1\", \"target\": \"step2\"},\n        {\"source\": \"step2\", \"target\": \"end\"}\n    ]\n}\n\nascii_art = render(graph)\nprint(ascii_art)","lang":"python","description":"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`."},"warnings":[{"fix":"Always use `pip install graphtty` and `from graphtty import render` to ensure you're using this specific library.","message":"Be aware of name collisions with other Python libraries like `graffiti`, `graphiti`, or `graphyte` that serve different purposes (e.g., declarative computation, temporal context graphs, Graphite metrics). Ensure you are importing `graphtty` from the correct package.","severity":"gotcha","affected_versions":"All"},{"fix":"Structure your graph data with explicit 'source' and 'target' for edges, representing directed relationships. For undirected graphs, explicitly define a reciprocal edge for each connection.","message":"graphtty is explicitly designed for *directed* graphs. While you can represent undirected relationships by adding two directed edges (A->B and B->A), the rendering will reflect these as distinct directed connections. Attempting to pass a graph structure not adhering to the directed graph format may lead to unexpected visual output.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Run `pip install graphtty` in your terminal to install the package.","cause":"The graphtty library is not installed in the current Python environment or the environment is not activated.","error":"ModuleNotFoundError: No module named 'graphtty'"},{"fix":"The `render` function expects a dictionary argument that defines the graph's nodes and edges. Ensure you pass a valid graph dictionary, e.g., `render(my_graph_dict)`.","cause":"`graphtty.render` was called without providing the necessary graph dictionary.","error":"TypeError: render() missing 1 required positional argument: 'graph'"},{"fix":"Ensure every node dictionary in your graph includes at least both an 'id' (unique identifier) and a 'name' (display label) key.","cause":"Node dictionaries within the 'nodes' list of your graph are missing the mandatory 'id' or 'name' keys. These keys are crucial for graphtty to identify and label nodes.","error":"KeyError: 'id' (or 'name') is missing from a node definition."}]}