Skip to main content

Flask-Deprecate

https://img.shields.io/pypi/v/flask_deprecate.svg https://img.shields.io/travis/timmartin19/flask_deprecate.svg Documentation Status

Easy decorators for deprecating flask views and blueprints

Example

from flask import Flask, Response

from flask_deprecate import deprecate_view

app = Flask('myapp')

@app.route('/myroute')
@deprecate_view("Don't use this!")
def myroute():
    return Response()

An HTTP compliant “Warning” header is injected indicating the route is deprecated and optionally providing an upgrade path.

You can also deprecate an entire blueprint in favor of a new one

from flask import Flask, Response, Blueprint

from flask_deprecate import deprecate_blueprint

old_bp = Blueprint('old', 'old', url_prefix='/v1')
new_bp = Blueprint('new', 'new', url_prefix='/v2')

@old_bp.route('/my_route')
def my_old_route():
    return Resonse()

@new_bp.route('/my_new_route')
def my_new_route():
    return Response()

deprecate_blueprint(old_bp, new_blueprint=new_bp)
app.register_blueprint(old_bp)
app.register_blueprint(new_bp)

This will inject the Warning header for every route on the old blueprint and additionally direct the client to use the new /v2 api.

Documentation

You will need to install the package dependencies first, see the Installation section for details.

To build and open the documentation simply run:

bin/build-docs

Installation

If you need to install pyenv/virtualenvwrapper you can run the bin/setup-osx command Please note that this will modify your bash profile

Assuming you have virtualenv wrapper installed

mkvirtualenv flask-deprecate
workon flask-deprecate
pip install -r requirements_dev.txt
pip install -e .

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.1.0 (2018-02-07)

  • First release on PyPI.

Metadata

Release files for flask-deprecate 0.1.3

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-deprecate 0.1.3
File Size Uploaded Provenance Actions
flask-deprecate-0.1.3.tar.gz 12.8 kB Without provenance Details for flask-deprecate-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flask-deprecate 0.1.3
File Interpreter ABI Platform Actions
flask_deprecate-0.1.3-py2.py3-none-any.whl Python 3, Python 2 none any Details for flask_deprecate-0.1.3-py2.py3-none-any.whl

Total release size: 19.1 kB

Release files / flask-deprecate-0.1.3.tar.gz

Download URL flask-deprecate-0.1.3.tar.gz
Size 12.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4c184765622e6d9baadab929ac54bc818d43ee074c94649efd623ec0e7875274
BLAKE2b-256 checksum
How to use checksums
fe33815d256dc821d8584813c5c30b74a0f565db50e812f82fa724b015958c7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / flask_deprecate-0.1.3-py2.py3-none-any.whl

Download URL flask_deprecate-0.1.3-py2.py3-none-any.whl
Size 6.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
8aa44313f8a18098a5c88cae6265f72008d0549a678f4db902856bcd42e1dc42
BLAKE2b-256 checksum
How to use checksums
2a695b7252c7235de335524788cc03e9f16a7bbbe6f82e172a3dcea241b871b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for flask-deprecate 0.1.3

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