Hi Bert, thanks for the thought - sqlalchemy is something I need to look at - however, for this sort of basic analysis an embedded database is simple and there are no 'production database' issues. Here SQLite is perfectly adeqate, although for a large dataset, I might opt for the embedded OLAP database, DuckDB.
I'll definitely look at sqlalchemy in the future, though, from the brief look I've had, it seems interesting.