Here’s a pseudo-example to illustrate the basic concepts:
import pg_simple
pg_simple.config_pool(dsn='dbname=my_db user=my_username ...')
with pg_simple.PgSimple() as db:
db.insert('table_name',
data={'column': 123,
'another_column': 'blah blah'})
db.commit()
with pg_simple.PgSimple() as db1:
rows = db1.fetchall('table_name')