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.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
webargs-0.1.0.tar.gz
(7.0 kB
view hashes)
Built Distribution
Close
Hashes for webargs-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b834372e5d1d442effb3e3260b915cd51f272ba2f5dc3b085e0c42732869220 |
|
MD5 | 6e2b13e2156bdaea58751ce03d616323 |
|
BLAKE2b-256 | 69168c9dd87e2d69ff394244269b8081fab8e7378017e83e92e7f4b5a7d87256 |