Skip to main content

Directed Acyclic Graph implementation for Django & Postgresql

Project description

codecov PyPI last commit Documentation Status made-with-python

Django & Postgresql-based Directed Acyclic Graphs

The main distinguishing factor for this project is that it can retrieve entire sections of a graph with far fewer queries than most other packages. The trade off is portability: it uses Postgres' Common Table Expressions (CTE) to achieve this and is therefore not compatible with other databases.

NOTE: Not all methods which would benefit from CTEs use them yet. This project is a work in progress. Again, this project is a work in progress. While functional, it is not yet fully optimized.

The primary purpose of this package is to build and manipulate DAGs. If you are looking for graph analysis or visualization, this is not the right package.

Currently, django-postgresql-dag provides numerous methods for retrieving nodes, and a few for retrieving edges within the graph. In-progress are filters within the CTEs in order to limit the area of the graph to be searched, ability to easily export to NetworkX, and other improvements and utilities.


Quickstart example


pip install django-postgresql-dag

With optional dependencies for using transformations:

pip install django-postgresql-dag[transforms]


See the checklists in issues to understand the future goals of this project.


  1. This excellent blog post
  2. django-dag
  3. django-dag-postgresql
  4. django-treebeard-dag

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-postgresql-dag, version 0.3.1
Filename, size File type Python version Upload date Hashes
Filename, size django_postgresql_dag-0.3.1-py3-none-any.whl (20.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size django-postgresql-dag-0.3.1.tar.gz (24.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page