Registry / type-stubs / types-flask-sqlalchemy

types-flask-sqlalchemy

JSON →
library2.5.9.4pypypiunverified

Third-party type stubs for Flask-SQLAlchemy, provided by the typeshed project. Version 2.5.9.4 corresponds to stubs for Flask-SQLAlchemy 2.5.x. These stubs are installed to enable type checking (e.g., with mypy or Pyright) for Flask-SQLAlchemy usage. Release cadence follows upstream typeshed updates.

pip install types-flask-sqlalchemy
INSTALL
IMPORT
SIG · TYPES-FLASK-SQLALC
T
types-flask-sqlalchemy
type-stubspythonv2.5.9.4
Install
1.6s avg
Import
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.5.9.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 20MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SQLAlchemy
from flask_sqlalchemy-stubs import SQLAlchemy
from flask_sqlalchemy import SQLAlchemy

Minimal Flask-SQLAlchemy app with type stubs enabling type checking.

from flask import Flask from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///:memory:' app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False db = SQLAlchemy(app) class User(db.Model): id = db.Column(db.Integer, primary_key=True) username = db.Column(db.String(80), unique=True) with app.app_context(): db.create_all() db.session.add(User(username='example')) db.session.commit() print(User.query.first().username)
Debug
Known issues
gotchaEnsure both Flask-SQLAlchemy and types-Flask (or stubs for Flask) are installed. Missing stub dependencies will cause mypy to report 'library stubs not found' errors.
fix
Run: pip install Flask-SQLAlchemy types-Flask
affects: all
gotchaThe 'db.relationship()' return type may not be fully stubbed. Use 'Mapped' or explicit type hints for complex relationships.
fix
Use annotation: from typing import List; users: List['User'] = db.relationship('User')
affects: 2.5.9.x
gotchaMypy may raise 'Missing type hints' for methods like 'query.filter_by()' due to incomplete stubs. This is a known limitation.
fix
Suppress with '# type: ignore[no-untyped-call]' or upgrade to Flask-SQLAlchemy 3.x and use SQLAlchemy 2.0 style.
affects: all
Upgrade
Version history
2.5.9.4latest on PyPI · released May 10, 2023
Audit
Dependencies
Flask-SQLAlchemyrequiredRequired runtime dependency; stubs are only useful when the actual package is installed.
FlaskoptionalFlask-SQLAlchemy depends on Flask; stubs also expect Flask types (e.g., from types-Flask).
Agent activity
36 hits · last 30 days
node
32
Meta
2
OpenAI (training)
1
Resources
types-flask-sqlalchemy — pip install types-flask-sqlalchemy · libregistry