{"repo":"OmenApps/django-postgresql-dag","free":true,"listed":false,"github":"https://github.com/OmenApps/django-postgresql-dag","clone":"git clone https://github.com/OmenApps/django-postgresql-dag.git","description":"Directed Acyclic Graphs with a variety of methods for both Nodes and Edges, and multiple exports (NetworkX, Pandas, etc). This project is the foundation for a commercial product, so expect regular improvements. PR's and other contributions are welcomed.","language":"Python","stars":54,"topics":["django","graph","dag","graph-algorithms","directed-acyclic-graph","directed-graph","postgresql","cte","common-table-expression"],"license":"Apache-2.0","category":"databases-storage","readme_excerpt":"Django & PostgreSQL-based Directed Acyclic Graphs Model directed acyclic graphs in Django without paying for the traversal one query at a time. A lot of graph libraries walk a hierarchy level by level, firing a query for each generation. This one pushes the whole traversal down into PostgreSQL with recursive Common Table Expressions (CTEs), so reading every descendant of a node, every ancestor, or the path between two nodes is a single query regardless of how deep the graph runs. The catch is portability. That speed comes from Postgres-specific SQL, so this library runs on PostgreSQL only. SQLite, MySQL, and the rest are not supported, and that is unlikely to change. Is this the right package? It is a good fit if you want to build and manipulate DAGs that live in your database: add and remove edges, walk ancestors and descendants, find paths, and run the usual DAG algorithms directly against your tables. It is the wrong fit if you mainly want graph analysis or visualization . If your graph fits in memory and you just want to run algorithms over it, NetworkX or rustworkx will serve you better. When you do need them, the transforms extra hands your data straight to either one. A quick taste Define an edge model first, then the node model that connects through it: Then wire up a graph and ask it questions: Adding an edge that would close a loop raises an error by default, so the graph stays acyclic without you policing it. You can relax that (and the duplicate/redundant-edge che","default_branch":null,"files":null,"tree":[],"storefront":"/r/OmenApps","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/OmenApps/django-postgresql-dag/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}