Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Codacy Badge Codacy Badge Build Status pre-commit


The psqlgraph library is a layer on top of SQLAlchemy's ORM layer that attempts to capitalize on the benefits of SQL while utilizing Postgresql's JSONB support for SQL-less flexibility. Psqlgraph allows you to interact with your data graphically by defining Node and Edge models to maintain flexible many-to-many relationships.


For usage documentation please see /doc/build/html.



Before continuing you must have the following programs installed:

The psqlgraph library requires the following pip dependencies

Project Dependencies

Project dependencies are managed using PIP

pip install

# Mac M2 - assuming you `brew install postgresql@13`
$ export PATH=$PATH:/opt/homebrew/opt/postgresql@13/bin/

$ pip install --no-deps -r dev-requirements.txt

Building Documentation

Documentation is built using Sphinx.

❯ cd doc
❯ make html
sphinx-build -b html -d build/doctrees   source build/html
Running Sphinx v1.2.3
dumping object inventory... done
build succeeded.

Build finished. The HTML pages are in build/html.

Test Setup

Running the setup script will:

  1. Setup the test postgres tables
❯ python psqlgraph/
Setting up test database
Dropping old test data
Creating tables in test database

Setup pre-commit hook to check for secrets

We use pre-commit to setup pre-commit hooks for this repo. We use detect-secrets to search for secrets being committed into the repo.

To install the pre-commit hook, run

pre-commit install

To update the .secrets.baseline file run

detect-secrets scan --update .secrets.baseline

.secrets.baseline contains all the string that were caught by detect-secrets but are not stored in plain text. Audit the baseline to view the secrets .

detect-secrets audit .secrets.baseline


Read how to contribute here


Running the setup script will test the library against a local postgres installation

❯  pip install pytest
❯  cd test
❯  py.test -v