In [1]:
import psycopg2
import sys
import json
In [2]:
with open('config.json') as f:
conf = json.load(f)
conn_str = "host={} dbname={} user={} password={}".format(conf['host'], conf['database'], conf['user'], conf['passw'])
In [ ]:
conn = psycopg2.connect(conn_str)