An implementation of the closure table pattern in Python + SQL
A closure table is a table that permits to represent hierarchical data or a tree structure in a SQL table and query them efficiently without having to create recursive queries.
See for instance: https://technobytz.com/closure_table_store_hierarchical_data.html
This particular program was written for use with SQLite but the SQL is standard and thus adaptation to other databases should be straightforward.
Published under MIT license