SQLAlchemy
Database Abstraction Library
Decision gist · record as of 2026-08-14
Yes. SQLAlchemy is a foundational, actively maintained library with no known vulnerabilities, low installation friction, and permissive licensing. It is the de facto standard ORM for Python and appropriate for nearly any project requiring structured database access—from small utilities to large enterprise applications. Install it unless you have specific reasons to use raw SQL or an alternative ORM.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Installation is straightforward with low friction; the package has only three runtime dependencies (importlib-metadata, greenlet, typing-extensions) and is actively maintained with a recent release.
License · maintenance · safety
MIT (permissive) — SQLAlchemy is distributed under the MIT license, a permissive open-source license that allows commercial and private use with minimal restrictions.
last release 2026-08-11 (3 days) · last repo commit 2026-08-13 · 12,080 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 422,737,345 downloads/mo, #100 on PyPI
Alternatives
Verify before relying
pip install sqlalchemy
from sqlalchemy import create_engine, Column, Integer, String
from sqlalchemy.orm import declarative_base, Session
Base = declarative_base()
engine = create_engine('sqlite:///:memory:')
class User(Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
name = Column(String)
Base.metadata.create_all(engine)
session = Session(engine)
session.add(User(name='Alice'))
session.commit()- Whether the package supports async/await patterns for non-blocking database operations
- Performance characteristics and query optimization capabilities for large-scale applications
What it is and what it does
SQLAlchemy is a mature, production-grade database toolkit that bridges Python objects and relational databases. It offers two complementary layers: a high-level ORM for declaring domain models as Python classes and automatically persisting them to a database, and a lower-level Core for constructing SQL expressions programmatically and executing raw queries. The ORM uses identity map, unit of work, and data mapper patterns to handle transparent object persistence with automatic transaction management. The Core provides a full SQL expression language, schema metadata introspection, connection pooling, and type coercion independent of the ORM.
Developers use SQLAlchemy to avoid writing raw SQL while retaining full control over query structure and database behavior. Its philosophy emphasizes that ORMs should not hide relational database capabilities; instead, it provides patterns for building custom mediation layers between domain models and schemas. The package supports modern Python versions (3.7 through 3.15) and works with both CPython and PyPy, making it suitable for a wide range of applications from small scripts to large enterprise systems.
Use it for
- Build web applications with declarative ORM models that map Python classes to database tables automatically
- Construct complex SQL queries programmatically using the Core expression language without writing raw SQL strings
- Reflect existing database schemas into Python metadata objects for introspection and code generation
- Manage database connections and transactions consistently across a multi-layer application architecture
- Migrate between different database backends (PostgreSQL, MySQL, SQLite, Oracle) with minimal code changes
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
SQLAlchemy is a foundational, actively maintained library with no known vulnerabilities, low installation friction, and permissive licensing. It is the de facto standard ORM for Python and appropriate for nearly any project requiring structured database access—from small utilities to large enterprise applications. Install it unless you have specific reasons to use raw SQL or an alternative ORM.
Install
sqlalchemy on PyPI
Before you install
Installation is straightforward with low friction; the package has only three runtime dependencies (importlib-metadata, greenlet, typing-extensions) and is actively maintained with a recent release.
License in practice
SQLAlchemy is distributed under the MIT license, a permissive open-source license that allows commercial and private use with minimal restrictions.
Quickstart
pip install sqlalchemy
from sqlalchemy import create_engine, Column, Integer, String
from sqlalchemy.orm import declarative_base, Session
Base = declarative_base()
engine = create_engine('sqlite:///:memory:')
class User(Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
name = Column(String)
Base.metadata.create_all(engine)
session = Session(engine)
session.add(User(name='Alice'))
session.commit()
Verify before relying
- Whether the package supports async/await patterns for non-blocking database operations
- Performance characteristics and query optimization capabilities for large-scale applications
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.7 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagesimportlib-metadatagreenlettyping-extensions |
| Maintenance | Actively maintained 3 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 422,737,345 / month, #100 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Database :: Front-Ends |
Evidence: sqlalchemy-2.0.52-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “sql toolkit python”
- SQLAlchemySQLAlchemy is a Python SQL toolkit and Object Relational Mapper (ORM)…
- sqlalchemy-vertica-pythonProvides a SQLAlchemy dialect for Vertica using the pure-Python…
- sqlalchemy-redshiftProvides a SQLAlchemy dialect for Amazon Redshift, enabling ORM and…
Give your agent the search over MCP, or paste the wish link into any chat.
More Front-Ends packages
psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.
Alembic generates and manages database schema migrations for SQLAlchemy applications, handling version control of database structure changes with support for upgrades, downgrades, and auto-generation from model changes.
Install it if you use SQLAlchemy and need to version-control schema changes; skip it only if you manage migrations manually or use a different ORM entirely.
A Python client library for connecting to and querying Weaviate, a vector database that enables semantic search and AI-powered data retrieval.
A Python client library that connects to Databricks clusters and SQL warehouses using a Thrift-based protocol, conforming to the Python DB API 2.0 specification and supporting Arrow-based data exchange.
Install it if you need to query Databricks clusters or SQL warehouses from Python.
Psycopg 3 is a PostgreSQL database adapter for Python that enables applications to connect to, query, and manage PostgreSQL databases using Python code.
Install it if you need to connect Python to PostgreSQL.
asyncpg is an asyncio-native PostgreSQL client library that executes queries asynchronously over the PostgreSQL binary protocol, enabling non-blocking database access in async Python applications.
See also dataset · GeoAlchemy2 · sqltap · tortoise-orm · sqlalchemy-views · sqlalchemy-mixins · records · pony · django-query-builder · sqlalchemy-searchable