python <> postgres (db)
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
Data Troll.pdf

Python <> Postgres



  • clone the repo:

git clone

  • get pip

  • test pip:

pip install doge


Create virtual env

pip install virtualenv

virtualenv -p /usr/bin/python2.7 db_py

source db_py/bin/activate

For when we are done:

Run requirements

  • pip install requirements:

pip install -r requirements.txt

trouble with psycopg2???

Now you are ready to start...

Becoming the Official Data Troll

...aka the Data Guardian

...aka the One who says "You Shall Not Pass"


You are the data troll who allows what data can be pushed up. All data requests are in your hands. But first you need to become an official data troll by getting your info in the data troll table (you need to be legit in the database or else it didn't happen ;P)


This is a super simple example of how python can be friends with database (in this case postgres). The goal is to show how simple it is to use python to interact with postgres while having oodles of fun! woo parseltongue :D


There will be one table that we will be pushing data to: user_scratch.data_trolls

Fields you will be updating via command line:

  • name (text)
  • favorite_color (text)
  • title (text)
  • enjoyed (boolean)