Registry / type-stubs / types-flask-migrate

types-flask-migrate

JSON →
library4.1.0.20260508pypypiunverified

This library provides static type checking stubs for Flask-Migrate, enabling tools like MyPy to verify type correctness in applications using Flask-Migrate. It is part of the Python typeshed project, which maintains a collection of high-quality type hints for various Python packages. Updates are released regularly to keep pace with changes in the runtime libraries they type-check.

pip install types-flask-migrate
INSTALL
IMPORT
SIG · TYPES-FLASK-MIGRAT
T
types-flask-migrate
type-stubspythonv4.1.0.20260508
Install
3.9s avg
Import
Disk
46MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v4.1.0.20260508 · 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.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 47.4MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 3.9s · import 0.000s · 46MB
46MB installed
● package 46MB
Code
Verified usage

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

Migrate
from flask_migrate-stubs import Migrate
from flask_migrate import Migrate

To use `types-flask-migrate`, install it alongside `flask-migrate` and `mypy`. The stubs provide type hints for your code that uses `flask-migrate`. There is no direct runtime import or usage of `types-flask-migrate` itself; it's consumed by type checkers. The example demonstrates a minimal Flask-Migrate setup that `mypy` would then analyze.

import os from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate # Basic Flask application setup app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = os.environ.get('DATABASE_URL', 'sqlite:///app.db') app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False db = SQLAlchemy(app) # Initialize Flask-Migrate migrate = Migrate(app, db) # Define a simple model (for demonstration) class User(db.Model): id: int = db.Column(db.Integer, primary_key=True) name: str = db.Column(db.String(128)) # Example usage (not run at runtime, for type checking only) # def create_db_and_migrate(): # with app.app_context(): # db.create_all() # # In a real app, you'd run 'flask db migrate' and 'flask db upgrade' via CLI print('Flask-Migrate types loaded. Run `mypy your_app.py` to check types.')
Debug
Known issues
gotchaType stubs (like `types-flask-migrate`) must match the version of the runtime library (`flask-migrate`) as closely as possible. Significant version mismatches can lead to incorrect type errors or missing type information.
fix
Ensure `flask-migrate` and `types-flask-migrate` are up-to-date. If issues persist, check the `typeshed` GitHub issues for specific version compatibility notes.
affects: All versions
gotcha`types-flask-migrate` provides stubs for `flask_migrate`, but it does not include stubs for `Flask-SQLAlchemy` or `SQLAlchemy` directly. You'll likely need `types-flask-sqlalchemy` and `types-sqlalchemy` for full type coverage.
fix
Install `types-flask-sqlalchemy` and `types-sqlalchemy` if your project uses them to achieve comprehensive type checking.
affects: All versions
gotchaType stubs from typeshed are sometimes incomplete for very new features or less common use cases in the underlying library. While generally comprehensive, edge cases might lack full typing.
fix
If encountering `mypy` errors due to missing stubs for specific `flask-migrate` features, consider contributing to `typeshed` or using `# type: ignore` as a temporary workaround with a comment explaining why.
affects: All versions
Upgrade
Version history
4.1.0.20260508latest on PyPI · released May 8, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
19 hits · last 30 days
node
18
OpenAI (training)
1
Resources
types-flask-migrate — pip install types-flask-migrate · libregistry