Skip to main content

Flask-Alembic

Flask-Alembic is a Flask extension that provides a configurable Alembic database migration environment. Supports Flask-SQLAlchemy, Flask-SQLAlchemy-Lite, or plain SQLAlchemy. Supports Alembic's single and multiple database templates.

Pallets Community Ecosystem

Basic Usage

You've created a Flask application and some models with Flask-SQLAlchemy. Now start using Flask-Alembic:

from flask_alembic import Alembic

# Initialize the extension
alembic = Alembic()
alembic.init_app(app)

Commands are added to the flask CLI:

$ flask db --help
$ flask db revision "making changes"
$ flask db upgrade

You can also access Alembic's functionality from Python:

with app.app_context():
    # Auto-generate a migration
    alembic.revision("making changes")

    # Upgrade the database
    alembic.upgrade()

    # Access the internals
    environment_context = alembic.env

Differences from Alembic

  • Configuration is taken from Flask.config instead of alembic.ini and env.py.
  • Engines and model/table metadata are taken from Flask-SQLAlchemy(-Lite) if available, or can be configured manually.
  • The migrations are stored directly in the migrations folder instead of the versions folder.
  • Provides the migration environment instead of env.py and exposes Alembic's internal API objects.
  • Differentiates between CLI commands and Python functions. The functions return revision objects and don't print to stdout.
  • Allows operating Alembic at any API level while the app is running, through the exposed objects and functions.
  • Adds a system for managing independent migration branches and makes it easier to work with named branches.
  • Does not (currently) support offline migrations. I don't plan to work on this but am open to patches.
  • Does not (currently) support async engines. I don't plan to work on this but am open to patches.

Metadata

Release files for Flask-Alembic 3.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Flask-Alembic 3.3.0
File Size Uploaded
flask_alembic-3.3.0.tar.gz 13.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Flask-Alembic 3.3.0
File Interpreter ABI Platform
flask_alembic-3.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 25.6 kB

Release files / flask_alembic-3.3.0.tar.gz

Download URL flask_alembic-3.3.0.tar.gz
Size 13.1 kB
Tags Source
SHA-256 checksum
How to use checksums
647cefec437657728af23c232c8f0ab5c0a102b5021a1cc5688963ca55d262c0
BLAKE2b-256 checksum
How to use checksums
4a07734d106c28e6d4e31bc86b01ec6092759b4fcb9701561f87e2705a8ae2c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release files / flask_alembic-3.3.0-py3-none-any.whl

Download URL flask_alembic-3.3.0-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
61b1e77fda122b2ad9bd25d40b7f1bf38ab67caca3277176c48e6dfbf11be63e
BLAKE2b-256 checksum
How to use checksums
39ab7d8d383209c82aec80ebfd7e2e30974708b7f8d54d97f9c7eb848c11d905
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

3.3.0 This release

2 release files

3.2.0

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.2.1

2 release files

1.2

2 release files

1.1.1

1 release file

1.1

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page