Did you try the tutorial in the Postgresql documentation?
https://www.postgresql.org/docs/current/tutorial.html
The psycopgb library is an easy way to use a Postgresql database from Python:
https://www.postgresql.org/docs/current/tutorial.html
The psycopgb library is an easy way to use a Postgresql database from Python: