Learn SQLAlchemy
Python's SQL toolkit and ORM: Core expression language plus mapped classes
SQLAlchemy is the standard Python library for working with relational databases. Its Core layer builds SQL from Python expressions across PostgreSQL, MySQL, SQLite and more, and its ORM maps classes to tables with sessions, relationships and a unit of work. It sits under FastAPI, Flask and countless data pipelines, so knowing it well pays off in almost any Python back end.
Before you start
How deep do you want to go?
1. EssentialsRead and write simple code, do the everyday basics
2. PracticalUse it productively at work, with the usual idioms
3. AdvancedThe less common features, performance and trade-offs
4. ExpertInternals and the edge cases experts know