SQLAlchemy

Python's most widely used SQL toolkit and ORM, offering both a SQL expression language and full ORM.

SQLAlchemy has two layers: Core, a composable SQL expression system, and the ORM, which maps classes to tables using the unit-of-work pattern. Version 2.0 unified the APIs, added first-class typing and async support. Alembic, from the same author, handles migrations.

Type
Library
Category
Data
Maintainer
Mike Bayer and SQLAlchemy authors
First released
2006
License
Open source (MIT)
Pricing
Open source
Level
Intermediate
Technologies
python, sql, postgresql
GitHub stars
12,330
Weekly downloads
110,500,226 (pypi)
Latest release
[object Object]
Last verified
26 Nov 2026

What SQLAlchemy is used for

  • Database access in Flask/FastAPI apps
  • Data engineering scripts
  • Complex SQL generation

Strengths

  • Very powerful and flexible
  • Supports many databases
  • Excellent documentation

Limitations

  • Large API with a learning curve
  • Session semantics confuse newcomers

SQLAlchemy alternatives

How it relates to other tools

Built with the same technologies

Learn SQLAlchemy

Official links

Sources

Explore