psycopg2 connection options code example
Example 1: psycopg2 connection string
#Define our connection string
conn_string = "host='localhost' dbname='my_database' user='postgres' password='secret'"
Example 2: psycopg2 connection
conn = psycopg2.connect("dbname=test user=postgres password=secret")