roed314 / psycodict

Dictionary-based python interface to an SQL database
Other
1 stars 3 forks source link

psycodict: dictionary-based python interface to PostgreSQL databases

This project was split off from the L-functions and modular forms database so that other projects could use the SQL interface that we created for that project.

Built upon psycopg2, the core of the interface is the ability to create SELECT queries using a dictionary. In addition, the package provides a number of other features that were useful for the LMFDB:

Install

pip3 install -U "psycodict[pgbinary] @ git+https://github.com/roed314/psycodict.git"

or

pip3 install -U "psycodict[pgsource] @ git+https://github.com/roed314/psycodict.git"

Getting started

You will first need to install postgres and create a user and a database. For example, you might execute the following commands in psql:

CREATE DATABASE database_name;
CREATE USER username;
ALTER USER psetpartners WITH password 'good password';
GRANT ALL PRIVILEGES ON DATABASE database_name TO username;