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.
Install & Compatibility
Where this runs
tested against v0.2.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.9MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 1.6s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
The core Graph object is imported from the 'asciidag.graph' submodule.
from asciidag.graph import Graph
Node objects, representing elements in the DAG, are imported from 'asciidag.node'.
from asciidag.node import Node
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)`.
from asciidag.graph import Graph
from asciidag.node import Node
graph = Graph()
# Define nodes and their relationships (parents)
root = Node('root')
grandpa = Node('grandpa', parents=[root])
tips = [
Node('child', parents=[
Node('mom', parents=[
Node('grandma', parents=[
Node('greatgrandma', parents=[]),
]),
grandpa,
]),
Node('dad', parents=[
Node('bill', parents=[
Node('martin'),
Node('james'),
Node('paul'),
Node('jon'),
])
]),
Node('stepdad', parents=[grandpa]),
]),
Node('foo', [Node('bar')]),
]
# Display the graph
graph.show_nodes(tips)
Upgrade
Version history
Breaking-change detection hasn't run for this library yet.
Audit
Security & dependencies
CVE tracking and dependency tree are planned for a later release.