A utility library for parsing HTTP request arguments, with built-in support for popular web frameworks, including Flask and Django.
Project description
Homepage: https://webargs.readthedocs.org/
Webargs is a Python utility library for parsing HTTP request arguments, with built-in support for popular web frameworks, including Flask and Django.
from flask import Flask
from webargs import Arg
from webargs.flaskparser import use_args
app = Flask(__name__)
hello_args = {
'name': Arg(str, required=True)
}
@app.route('/')
@use_args(hello_args)
def index(args):
return 'Hello ' + args['name']
if __name__ == '__main__':
app.run()
# curl http://localhost:5000/\?name\='World'
# Hello World
Install
pip install -U webargs
webargs supports Python >= 2.6 or >= 3.3.
Documentation
Full documentation is available at https://webargs.readthedocs.org/.
License
MIT licensed. See the LICENSE file for more details.
Changelog
0.3.2 (2014-03-04)
Fix bug with parsing JSON in Flask and Bottle.
0.3.1 (2014-03-03)
Remove print statements in core.py. Oops.
0.3.0 (2014-03-02)
Add support for repeated parameters (#1).
Backwards-incompatible: All parse_* methods take arg as their fourth argument.
Add error_handler param to Parser.
0.2.0 (2014-02-26)
Bottle support.
Add targets param to Parser. Allows setting default targets.
Add files target.
0.1.0 (2014-02-16)
First release.
Parses JSON, querystring, forms, headers, and cookies.
Support for Flask and Django.
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 webargs-0.3.2.tar.gz
.
File metadata
- Download URL: webargs-0.3.2.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e74aaae8fe6d50f8c41db8ae10237ef78bb6ee5f0728a8217101b275584a988 |
|
MD5 | 161d6c4cc4a0672a682224af010a2c46 |
|
BLAKE2b-256 | 6bd61161e5a456e47285db181683efabfbfd8ff7442c74f68bd8263a5617132d |
Provenance
File details
Details for the file webargs-0.3.2-py2.py3-none-any.whl
.
File metadata
- Download URL: webargs-0.3.2-py2.py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d1ffce2fea879d801760e7474f8dfb213440e93da6fca382e51a08facfc9c5e |
|
MD5 | c005b05475927ade2cd5e94ae6cc4ea7 |
|
BLAKE2b-256 | daefe4fa856795e47740c52c90d2912612123c83a55adb43566d5c2643788606 |