{
  "id": "python-graphlib-table",
  "kind": "table",
  "slug": "python-graphlib",
  "iil_id": null,
  "note_url": "https://iinventedlight.com/library/notes/python-graphlib/",
  "title": "Python graphlib TopologicalSorter: order tasks and detect cycles",
  "columns": [
    "name",
    "source",
    "detail"
  ],
  "rows": [
    {
      "name": "add(node, *predecessors)",
      "source": "Python docs",
      "detail": "adds a node; calling it again for the same node unions the dependencies. Unknown predecessors are added automatically."
    },
    {
      "name": "add()",
      "source": "Python docs",
      "detail": "raises ValueError after prepare()."
    },
    {
      "name": "prepare()",
      "source": "Python docs",
      "detail": "raises CycleError on a cycle, but get_ready() can still return nodes until the cycle blocks progress."
    }
  ],
  "related_slugs": [
    "python-collections-containers",
    "python-itertools"
  ],
  "license": "CC-BY-4.0",
  "source_license": "PSF-2.0 (Python docs); PSF-2.0 (python/cpython (GitHub)); prose restates cited source lines in own words",
  "as_of": "2026-11-18",
  "status": "fill-draft-20261118",
  "note": "Restated from the note's GREEN sources; check those sources before relying on a value."
}