{"id":7943,"library":"asciidag","title":"Asciidag","description":"Asciidag is a Python library that draws Directed Acyclic Graphs (DAGs) as ASCII art, mimicking the output style of `git log --graph`. It is a direct, mechanical port of Git's log graphing code, currently at version 0.2.0. The project is explicitly stated as 'alpha quality' and subject to breaking API changes, with the last release in October 2020.","status":"active","version":"0.2.0","language":"en","source_language":"en","source_url":"https://www.github.com/sambrightman/asciidag","tags":["python","ascii-art","dag","graph","git","cli","visualization"],"install":[{"cmd":"pip install -U asciidag","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"note":"The core Graph object is imported from the 'asciidag.graph' submodule.","symbol":"Graph","correct":"from asciidag.graph import Graph"},{"note":"Node objects, representing elements in the DAG, are imported from 'asciidag.node'.","symbol":"Node","correct":"from asciidag.node import Node"}],"quickstart":{"code":"from asciidag.graph import Graph\nfrom asciidag.node import Node\n\ngraph = Graph()\n\n# Define nodes and their relationships (parents)\nroot = Node('root')\ngrandpa = Node('grandpa', parents=[root])\ntips = [\n    Node('child', parents=[\n        Node('mom', parents=[\n            Node('grandma', parents=[\n                Node('greatgrandma', parents=[]),\n            ]),\n            grandpa,\n        ]),\n        Node('dad', parents=[\n            Node('bill', parents=[\n                Node('martin'),\n                Node('james'),\n                Node('paul'),\n                Node('jon'),\n            ])\n        ]),\n        Node('stepdad', parents=[grandpa]),\n    ]),\n    Node('foo', [Node('bar')]),\n]\n\n# Display the graph\ngraph.show_nodes(tips)","lang":"python","description":"This quickstart demonstrates how to create a `Graph` object, define `Node`s with parent-child relationships, and then render the DAG to the console using `graph.show_nodes(tips)`."},"warnings":[{"fix":"Pin your dependency to a specific patch version (e.g., `asciidag==0.2.0`) and review the GitHub repository for any changes before upgrading.","message":"The library is explicitly labeled as 'alpha quality' and its API is 'subject to breaking API changes' at any time. Users should expect instability in future minor or patch releases, as there is no strong commitment to backward compatibility in the 0.x.x series.","severity":"breaking","affected_versions":"0.1.0 to 0.2.0 and future 0.x.x versions"},{"fix":"Be aware that the code style may be unusual. When contributing or debugging, refer to the original Git log graphing logic for context if Pythonic patterns are not immediately apparent.","message":"The codebase is a 'direct port of the Git log graphing code' and is described as 'not Pythonic'. This means the internal structure and coding conventions might not align with typical Python practices, potentially making it harder to debug or extend.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"The `Graph` and `Node` classes are located in submodules. Use `from asciidag.graph import Graph` and `from asciidag.node import Node` instead.","cause":"Attempting to import `Graph` or `Node` directly from the top-level `asciidag` package.","error":"ImportError: cannot import name 'Graph' from 'asciidag'"},{"fix":"Simplify the input DAG structure if possible. Review the `examples/demo.py` for typical usage patterns. If issues persist, consider reporting them on the GitHub issue tracker, providing a minimal reproducible example.","cause":"While asciidag aims to replicate Git's graph, its 'alpha quality' and direct port nature might lead to edge cases or less-than-optimal layouts for graphs significantly different from typical Git histories.","error":"Unexpected ASCII graph output or layout issues when providing complex DAG structures."}]}