Glossary: Algorithms Beyond the Basics
graphlib
Also written: TopologicalSorter, graphlib.CycleError, static_order
A Python standard-library module with a `TopologicalSorter` class. It takes a dict from each task to the tasks it depends on, and `static_order()` returns a valid order or raises `CycleError`.