Skip to main content

Flask-Alembic

This Flask extension provides a configurable Alembic migration environment around a Flask-SQLAlchemy database.

Full documentation

Installation

Install releases from PyPI:

pip install Flask-Alembic

Install the latest code from BitBucket:

pip install https://bitbucket.org/davidism/flask-alembic/get/default.tar.gz

Basic Usage

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

from flask_alembic import Alembic

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

# Auto-generate a migration
alembic.revision('making changes')

# Upgrade the database
alembic.upgrade()

# Access the internals
environment_context = alembic.env

Commands are included for Click (Flask 0.11, or Flask-CLI):

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

and Flask-Script:

$ python manage.py db --help

Differences from Alembic core

  • Configuration is taken from Flask.config instead of alembic.ini.

  • The migrations are stored directly in the migrations folder instead of the versions folder.

  • The extension provides the migration environment instead of env.py.

  • Does not (currently) support offline migrations or multiple databases.

  • Adds a system for managing independent migration branches and makes it easier to work with named branches.

Differences from Flask-Migrate

Flask-Migrate is a simple wrapper around the existing Alembic commands. It associates the Flask-SQLAlchemy database with Alembic, and wraps the Alembic commands with Flask-Script. It still requires the standard Alembic file structure, does not integrate with Flask configuration, and does not expose the Alembic internals.

Metadata

Release files for Flask-Alembic 2.0.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 2.0.0
File Size Uploaded Provenance Actions
Flask-Alembic-2.0.0.tar.gz 15.9 kB Without provenance Details for Flask-Alembic-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for Flask-Alembic 2.0.0
File Interpreter ABI Platform Actions
Flask_Alembic-2.0.0-py2.py3-none-any.whl Python 3, Python 2 none any Details for Flask_Alembic-2.0.0-py2.py3-none-any.whl

Total release size: 26.5 kB

Release files / Flask-Alembic-2.0.0.tar.gz

Download URL Flask-Alembic-2.0.0.tar.gz
Size 15.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1ccbca096bbb64ae2c76547164f6fd174f46d3b861c9a081d06593b2476010fe
BLAKE2b-256 checksum
How to use checksums
652b02722e01ea6739cf31c5ff01c41a9353050aba1becaaef4e712ffae8acd3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / Flask_Alembic-2.0.0-py2.py3-none-any.whl

Download URL Flask_Alembic-2.0.0-py2.py3-none-any.whl
Size 10.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
1d377ad8ba144f34c369f54706b67c9f927527cf39bf918c16ca0a99ce045dfe
BLAKE2b-256 checksum
How to use checksums
b1deebe0b3d6f89d923253c89c056f39ccf90c36914343959ce6dd44112103e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for Flask-Alembic 2.0.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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