skillfed

types-SQLAlchemy

Typing stubs for SQLAlchemy

types-sqlalchemy v1.4.53.38 503.6K downloads/30d#6,303 on PyPI5,108
Permissive license Apache-2.0 license Active released

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-sqlalchemy

uv

uv add types-sqlalchemy

poetry

poetry add types-sqlalchemy

Installing 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

License :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3Typing :: Stubs Only

Tags

sqlalchemy type stubssqlalchemy type checkingmypy sqlalchemysqlalchemy type hintspep 561 stubssqlalchemy pyrightstatic type checking database orm
type-stubssqlalchemytype-checking

More Database packages