Opensource.com - https://opensource.com/article/17/12/python-and-postgresql
Python is a programming language that lets you work quickly and integrate systems more effectively, and PostgreSQL is the world’s most advanced open source database. Those two work very well together. This article describes how to make the most of PostgreSQL (psql) when solving a simple problem. As tempting as it is to throw Python code at a problem, it’s not always the best choice.