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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19MB
glibcpy 3.10–3.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)
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).