https://www.postgresql.org/docs/current/tutorial.html
The psycopgb library is an easy way to use a Postgresql database from Python:
https://www.psycopg.org/psycopg3/docs/