No project description provided
Project description
Flask Parameters
This library defines some decorators to be used with Flask to inject URL query parameters as arguments into route functions. You can optionally perform type checking of the parameters based on the signature of the route function.
Example Usage
import flask
from flask_parameters import inject_query_params
from flask_parameters import inject_and_validate_query_params
from flask_parameters import register_error_handlers
app = flask.Flask(__name__)
register_error_handlers(app)
@app.route("/foo")
@inject_query_params()
def foo(arg, kwarg = 123) -> dict:
return {"arg": arg, "kwarg": kwarg}
@app.route("/strict_foo")
@inject_and_validate_query_params()
def strict_foo(arg: str, kwarg: int = 123) -> dict:
return {"arg": arg, "kwarg": kwarg}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
flask-parameters-0.0.2.tar.gz
(4.6 kB
view hashes)
Built Distribution
Close
Hashes for flask_parameters-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 233197d79a2c6229cb71ff4de8b248a8646e95b2808c7081025fabcd0e2ba31a |
|
MD5 | 9abc364dcedbbf628ff60ceec3141345 |
|
BLAKE2b-256 | 57cc5a0795bf33952b25c4cc727191efd1a69f4bb028c1be6b7130419505fa9e |