Debgraph, a program like debtree to view all the Debian packages on your system, in a single graph.

Supports GEXF, DOT (Graphviz), and JSON-Lines output.

In development. Please note that API may change across 0.x versions.

License
    See COPYING

Installation
    pip install debgraph

Usage
DOT Example
    debgraph

    head debian.dot

    digraph Debian {
    "adduser" [label="adduser"];
    "adwaita-icon-theme" [label="adwaita-icon-theme"];
    "alsa-topology-conf" [label="alsa-topology-conf"];
    "alsa-ucm-conf" [label="alsa-ucm-conf"];
    "apparmor" [label="apparmor"];
    "apport" [label="apport"];
    "apport-core-dump-handler" [label="apport-core-dump-handler"];
    "apport-symptoms" [label="apport-symptoms"];
    "appstream" [label="appstream"];
    ...

GEXF Example
    debgraph debian.gexf

    head debian.gexf

    <?xml version="1.0" encoding="UTF-8"?>
        <gexf xmlns="http://www.gexf.net/1.3" version="1.3" xmlns:viz="http://www.gexf.net/1.3/viz" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.gexf.net/1.3 http://www.gexf.net/1.3/gexf.xsd">
            <meta lastmodifieddate="2026-06-30">
                <creator>debgraph</creator>
                <description>A graph of apt packages on a Debian system.</description>
            </meta>
            <graph defaultedgetype="directed" idtype="string" type="static">

            <attributes class="node">
                <attribute id="0" title="binary:Synopsis" type="string"/>
    ...

JSON-Lines Example
    debgraph debian.jsonl

    head debian.jsonl

    {"id": 1, "name": "adduser", "version": "3.153ubuntu1", "dependencies": ... }
    {"id": 2, "name": "adwaita-icon-theme", "version": "50.0-1", "dependencies": ... }
    {"id": 3, "name": "alsa-topology-conf", "version": "1.2.5.1-3build1", "dependencies": ... }
    {"id": 4, "name": "alsa-ucm-conf", "version": "1.2.15.3-1ubuntu1", "dependencies": ... }
    ...

Development
    pip install ".[tests]" .
    python -m pytest .