skillfed

Flask-Alembic

Integrate Alembic with Flask.

flask-alembic v3.2.0 110.8K downloads/30d#12,443 on PyPI47
Permissive license MIT AGING released

What it is and what it does

Flask-Alembic is a Flask extension that wraps Alembic, the industry-standard database migration tool, and integrates it directly into Flask's configuration and CLI. Instead of managing separate alembic.ini and env.py files, Flask-Alembic reads settings from Flask.config and automatically discovers your SQLAlchemy models and database engines from Flask-SQLAlchemy, Flask-SQLAlchemy-Lite, or plain SQLAlchemy. It provides both command-line commands (via `flask db`) and Python functions you can call within your application context, letting you generate migrations, apply upgrades, and access Alembic's internal API without leaving your Flask codebase.

The package is designed for teams already using Flask and SQLAlchemy who need to version and deploy schema changes reliably. It handles single and multiple database templates, supports named migration branches, and exposes Alembic's full API for advanced use cases. The main trade-offs are that offline migrations and async engines are not yet supported, and the project is maintained by the Pallets Community Ecosystem rather than as a primary focus.

Use it for:

  • Generate and apply database schema migrations automatically when deploying Flask applications with SQLAlchemy models.
  • Manage multiple independent databases or migration branches within a single Flask application.
  • Version control schema changes alongside application code using the `flask db` CLI during development.
  • Programmatically create and apply migrations from within Flask application code during runtime.
  • Transition from manual SQL scripts to tracked, reversible schema changes in existing Flask projects.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Flask-Alembic integrates Alembic database migrations into Flask applications, providing CLI commands and Python APIs to create, manage, and apply schema changes without writing raw SQL or configuration files.

Yes, if you are building a Flask application with SQLAlchemy and need reliable schema versioning. The low install friction, permissive license, recent maintenance, and integration with Flask's config system make it the natural choice for this use case. The aging maintenance status and lack of async/offline support are not blockers for typical Flask deployments, but verify those features are not required for your project.

Install

flask-alembic on PyPI

pip

pip install flask-alembic

uv

uv add flask-alembic

poetry

poetry add flask-alembic

Installing Flask-Alembic

Before you install

Low friction install with three straightforward dependencies. Last release was recent (2025-11-17) and the project remains actively maintained, though classified as aging rather than actively developed.

License in practice

MIT license is permissive; you can use, modify, and distribute this package with minimal restrictions, provided you include the license notice.

Quickstart

pip install flask-alembic

from flask_alembic import Alembic

alembic = Alembic()
alembic.init_app(app)

# Then use: flask db revision "description"
# Or: alembic.revision('description') in app context

Requires Python 3.10 or later; requires a Flask application instance and SQLAlchemy models to be useful.

Verify before relying

  • Whether the package works with async SQLAlchemy engines (description notes this is not currently supported).
  • Current state of offline migration support (description notes this is not currently supported).
  • Whether Flask-SQLAlchemy-Lite is actively maintained as an alternative to Flask-SQLAlchemy.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 3 — alembic, flask, sqlalchemy
Maintenance aging — 270 days since the last release
Last repo commit
First released
Downloads 110,807/month — #12,443 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: flask_alembic-3.2.0-py3-none-any.whl

Development Status :: 5 - Production/StableFramework :: FlaskProgramming Language :: PythonTyping :: Typed

Tags

flask database migrationsalembic flask integrationflask schema versioningdatabase migration tool flaskflask sqlalchemy migrationsmanage database changes flaskflask db cli commands
flask-extensiondatabase-migrationsschema-versioning

More Database packages