types-SQLAlchemy
Typing stubs for SQLAlchemy
What it is and what it does
types-SQLAlchemy is a stub-only package that provides type information for the SQLAlchemy ORM library. It is sourced from typeshed and allows static type checkers to understand and validate the types of SQLAlchemy objects and methods in your code. This enables IDE autocompletion, type error detection, and better code quality assurance when working with SQLAlchemy.
The package is designed for developers using SQLAlchemy versions prior to 2.0.0, which did not include native type annotations. If you are already on SQLAlchemy 2.0.0 or later, the package documentation explicitly recommends uninstalling types-SQLAlchemy in favor of the built-in annotations. The stubs are maintained as part of the typeshed project and receive updates through that repository.
Use it for:
- Enable mypy or pyright to type-check SQLAlchemy ORM code in a legacy codebase using SQLAlchemy 1.4.x
- Provide IDE type hints and autocompletion for SQLAlchemy queries and model definitions
- Enforce stricter type safety in CI/CD pipelines that run static type checkers on database layer code
- Support pytype or PyCharm's built-in type checking for SQLAlchemy-based applications
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides PEP 561 type stubs for SQLAlchemy, enabling type checkers like mypy, pyright, and pytype to validate code using SQLAlchemy.
Yes, if you are using SQLAlchemy 1.4.x and want type checking support—install friction is negligible and the stubs are actively maintained via typeshed. No, if you are on SQLAlchemy 2.0.0 or later, as the package itself recommends uninstalling in favor of SQLAlchemy's native type annotations. Check your SQLAlchemy version first.
Install
types-sqlalchemy on PyPI
pip
pip install types-sqlalchemyuv
uv add types-sqlalchemypoetry
poetry add types-sqlalchemyInstalling types-SQLAlchemy
Before you install
Low install friction with no runtime dependencies. Maintenance is active, though the latest release was in May 2023 and the package notes that SQLAlchemy 2.0.0+ includes its own type annotations, making this package potentially redundant for newer SQLAlchemy versions.
License in practice
Apache-2.0 permissive license allows use in commercial and open-source projects with minimal restrictions; attribution required.
Quickstart
pip install types-SQLAlchemy
# Then use with mypy, pyright, or similar type checker
# in your project configuration or command line
mypy --strict your_sqlalchemy_code.py
Only useful if you are using a type checker (mypy, pyright, pytype, or IDE type checking) and have SQLAlchemy installed. Not needed for SQLAlchemy 2.0.0 or later, which includes native type annotations.
Verify before relying
- Whether the stubs remain accurate for all SQLAlchemy 1.4.x patch versions beyond 1.4.53
- Coverage completeness for edge cases or less common SQLAlchemy APIs
Package facts
| License | Apache-2.0 license (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 1,201 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 503,640/month — #6,303 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: types_SQLAlchemy-1.4.53.38-py3-none-any.whl
Tags
More Database packages
psycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
redisPython client library for connecting to and…
permissive · top 1,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
sqlparsesqlparse tokenizes SQL text into a tree of…
permissive · top 1,000 on PyPI
dbt-adaptersProvides base adapter protocols and shared…
permissive · top 1,000 on PyPI
sqlalchemy2-stubsProvides PEP-484 typing stubs for SQLAlchemy…
permissive · top 5,000 on PyPI
types-Flask-SQLAlchemyProvides type stubs for Flask-SQLAlchemy to…
permissive · top 15,000 on PyPI
sqlalchemy-stubsProvides type stubs and a mypy plugin to enable…
permissive · top 5,000 on PyPI
scipy-stubsProvides type stubs for the entire SciPy…
permissive · top 5,000 on PyPI
trio-typingProvides PEP 561 type stubs and typing…
permissive · top 5,000 on PyPI
types-DateTimeRangeProvides type stubs for the DateTimeRange…
permissive · top 15,000 on PyPI
pybind11-stubgenGenerates PEP 561 type stubs for Python binary…
permissive · top 5,000 on PyPI
types-termcolorProvides type stubs for the termcolor package,…
permissive · top 15,000 on PyPI
types-chardetProvides type stubs for character encoding…
permissive · top 5,000 on PyPI
types-influxdb-clientProvides type stubs for influxdb-client,…
permissive · top 15,000 on PyPI