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
Built Distribution
File details
Details for the file flask-parameters-0.0.2.tar.gz
.
File metadata
- Download URL: flask-parameters-0.0.2.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91dda43991812cd22862b684a469672f96d8c692c1686539cfaba0681c9a2c7d |
|
MD5 | 9d2d53109ded23689f0339ffdfb56fc0 |
|
BLAKE2b-256 | 68b9e2e292290f39a038075a4b07257d627ce9fbf6fa52ef0ba0af1f9d97a74a |
File details
Details for the file flask_parameters-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: flask_parameters-0.0.2-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 233197d79a2c6229cb71ff4de8b248a8646e95b2808c7081025fabcd0e2ba31a |
|
MD5 | 9abc364dcedbbf628ff60ceec3141345 |
|
BLAKE2b-256 | 57cc5a0795bf33952b25c4cc727191efd1a69f4bb028c1be6b7130419505fa9e |