Skip to main content

Uncomment below for banners

Build status Code coverage Maintenance yes GitHub license Documentation Status

Flask-Continuum

Flask-Continuum is a lightweight Flask extension for providing data provenance and versioning support to Flask applications using SQLAlchemy. It is built on top of the sqlalchemy-continuum package, and provides a more Flask-y development experience for app configuration. If you’d like to configure your application with sqlalchemy-continuum directly, consult the sqlalchemy-continuum documentation.

Installation

To install the latest stable release via pip, run:

$ pip install Flask-Continuum

Alternatively with easy_install, run:

$ easy_install Flask-Continuum

To install the bleeding-edge version of the project (not recommended):

$ git clone http://github.com/bprinty/Flask-Continuum.git
$ cd Flask-Continuum
$ python setup.py install

Usage

Setting up the flask application with extensions:

from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_continuum import Continuum

app = Flask(__name__)
db = SQLAlchemy(app)
continuum = Continuum(app, db)

Or, using via the Flask app factory pattern:

from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_continuum import Continuum

db = SQLAlchemy()
continuum = Continuum(db=db)
app = Flask(__name__)
db.init_app(app)
continuum.init_app(app)

The following is a minimal example highlighting how the extension is used. Much of the example was taken from the SQLAlchemy-Continuum documentation to show how this plugin extends that package for a Flask application:

from flask_continuum import VersioningMixin

# defining database schema
class Article(db.Model, VersioningMixin):
    __tablename__ = 'article'

    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    name = db.Column(db.Unicode(255))
    content = db.Column(db.UnicodeText)


# later in api or request handlers
article = Article(name='Some article', content='Some content')
session.add(article)
session.commit()

# article has now one version stored in database
article.versions[0].name
# 'Some article'

article.name = 'Updated name'
session.commit()

article.versions[1].name
# 'Updated name'


# lets revert back to first version
article.versions[0].revert()

article.name
# 'Some article'

Documentation

For more detailed documentation, see the Docs.

Questions/Feedback

File an issue in the GitHub issue tracker.

Metadata

Release files for Flask-Continuum 0.1.7

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-Continuum 0.1.7
File Size Uploaded
Flask-Continuum-0.1.7.tar.gz 99.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Flask-Continuum 0.1.7
File Interpreter ABI Platform
Flask_Continuum-0.1.7-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 106.1 kB

Release files / Flask-Continuum-0.1.7.tar.gz

Download URL Flask-Continuum-0.1.7.tar.gz
Size 99.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c0f2863377da34c83a5cbda930a02019a0dbeaf8413c4cf1d85367ddc926d4fc
BLAKE2b-256 checksum
How to use checksums
3a3b76f1e43f8a3613331edf3192c6ce5c4ab16cb9bc47633a05555387e1c362
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.7.6

Release files / Flask_Continuum-0.1.7-py2.py3-none-any.whl

Download URL Flask_Continuum-0.1.7-py2.py3-none-any.whl
Size 7.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
c8574f67f0c9042b5ad7de35f923c994cd9a9db2f2ac083607ad53eb183864b9
BLAKE2b-256 checksum
How to use checksums
82a82c5173f5f583812e25003b08ac9cdee5c4398ea2b473cff263e27e0c4c9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.7.6

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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