On this page
Overview
SQLAlchemy is a Python SQL toolkit and ORM. Its Core covers SQL expressions, connections, transactions, connection pooling, and schema metadata, while the ORM adds identity-map, unit-of-work, and data-mapper patterns on the same foundation.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Use Core for explicit SQL expressions, connections, transactions, and schema metadata
The Engine is the central connection source, while Core provides the SQL Expression Language, schema metadata, connection pooling, type handling, and DBAPI integration. Applications can use these capabilities without adopting the ORM.
Use the ORM with identity-map, unit-of-work, and relationship loading patterns
The ORM combines declarative mapping with identity-map, unit-of-work, data-mapper, and relationship-loading patterns while preserving explicit relational composition for joins, subqueries, and related SQL constructs.
Sources: [2]
Best fit
Fits Python backends that need both ORM productivity and direct SQL control
It works well from CRUD-heavy applications to services with complex relational queries when one project needs to move between ORM and Core while choosing database-specific drivers and explicit transaction boundaries.
Before adoption
SQLAlchemy 2.1.3 requires Python 3.11+; choose drivers and transaction boundaries separately
SQLAlchemy 2.1.3 requires Python 3.11 or newer, while PostgreSQL, MySQL, Oracle, and other drivers are optional dependencies selected by the application. Connections do not commit automatically, so transaction boundaries remain explicit. Version 2.1.3 also fixes ORM and SQL compiler regressions, making mapping order and generated SQL useful upgrade regression checks.
Official sources
- [1]sqlalchemy/sqlalchemy — GitHub repository(2026-10-06)
- [2]SQLAlchemy 2.1.3 — README(2026-10-06)
- [3]SQLAlchemy 2.1.3 — pyproject.toml(2026-10-06)
- [4]SQLAlchemy 2.1 tutorial — Engine(2026-10-06)
- [5]SQLAlchemy 2.1 tutorial — Transactions(2026-10-06)
- [6]SQLAlchemy 2.1.3 release(2026-10-06)
- [7]SQLAlchemy MIT license(2026-10-06)
Supplemental curator note
A major strength is that Core remains useful independently of the ORM, so applications can move down to explicit SQL control without replacing the data-access foundation. Standardize database drivers, transaction boundaries, and Session lifecycle across the application.
Try it in 3 steps
- 1
Install SQLAlchemy 2.1.3
Pin the reviewed stable release. SQLAlchemy 2.1.3 requires Python 3.11 or newer.
python -m pip install "SQLAlchemy==2.1.3" - 2
Create an in-memory SQLite script
Use the same in-memory SQLite Engine pattern as the official tutorial so no external database is required.
cat > demo_sqlalchemy.py <<'PY' from sqlalchemy import create_engine, text engine = create_engine('sqlite+pysqlite:///:memory:') with engine.connect() as conn: value = conn.execute(text("select 'hello world'")).scalar_one() print(value) PY - 3
Run the query and inspect the result
A hello world result verifies the minimal Engine, Connection, and text() Core path.
python demo_sqlalchemy.py
Growth
Growth trends · Last 30 days
12,201 Stars
Trend data is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- python
- sql
- sqlalchemy
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- jOOQ6,794 Stars
3 shared tag(s) · 2 shared category(s)
Build SQL through a type-safe Java DSL and generate code from database schemas
Java - Hibernate ORM6,467 Stars
3 shared tag(s) · 2 shared category(s)
manage Java entity state, transactions, queries, and database dialects through a Jakarta Persistence/JPA relational persistence framework
Java - Sequel5,098 Stars
3 shared tag(s) · 2 shared category(s)
Keep SQL structure visible while combining datasets, models, transactions, and migrations in Ruby
Ruby - Bun4,984 Stars
3 shared tag(s) · 2 shared category(s)
add SQL-first query building and model mapping to Go's database/sql layer
Go - Spring Data JPA3,287 Stars
3 shared tag(s) · 2 shared category(s)
derive JPA CRUD, finder, pagination, and auditing behavior from repository interfaces
Java - asyncpg8,098 Stars
4 shared tag(s) · 2 shared category(s) · Same language
access PostgreSQL directly from asyncio through a high-performance Python driver
Python
Report incorrect information
Tell us if any listing information is incorrect or outdated.