deprecated-decorator-flask
A Flask decorator to mark pages as deprecated with visual warnings and HTTP headers.
Installation
pip install deprecated-decorator-flask
Usage
from flask import Flask
from deprecated_decorator_flask import deprecated
app = Flask(__name__)
# Basic usage
@app.route('/old-page')
@deprecated
def old_page():
return "<html><body><h1>Old Page</h1></body></html>"
# With custom message
@app.route('/old-page2')
@deprecated(message="Use /new-page instead.")
def old_page2():
return "<html><body><h1>Old Page 2</h1></body></html>"
# With sunset date
@app.route('/old-page3')
@deprecated(message="Use /new-page instead.", sunset="2025-09-01")
def old_page3():
return "<html><body><h1>Old Page 3</h1></body></html>"
Features
- Visual Warning: Adds a blinking red border around the page and a sticky warning banner
- HTTP Headers: Adds
Deprecation,X-Deprecated-Message, andSunsetheaders - Metadata: Decorated functions get
_deprecated,_deprecated_message, and_deprecated_sunsetattributes
License
MIT
Metadata
Release files for deprecated-decorator-flask 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| deprecated_decorator_flask-0.1.0.tar.gz | 3.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| deprecated_decorator_flask-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.7 kB
Release files / deprecated_decorator_flask-0.1.0.tar.gz
| Download URL | deprecated_decorator_flask-0.1.0.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c90a26c54f46d9cec5aac2991656d722dcbdb9b89ee9db90d28f20f825ba525c
|
|
BLAKE2b-256 checksum How to use checksums |
b8ee92538b1c39eacfc66d1b5492527d8321e38084beb9f8c42a513102b13abc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / deprecated_decorator_flask-0.1.0-py3-none-any.whl
| Download URL | deprecated_decorator_flask-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ca6eb33f708bf5dff4cea863427ccf4c07228f02c840082c6a4a93f701211b41
|
|
BLAKE2b-256 checksum How to use checksums |
4e9f402abd3045c1399a21f3aedd2afd02281b23862952dee75bc417daade25d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|