A friendly library for parsing and validating HTTP request arguments, with built-in support for popular web frameworks, including Flask, Django, Bottle, Tornado, Pyramid, webapp2, Falcon, and aiohttp.
Project description
Homepage: https://webargs.readthedocs.io/
webargs is a Python library for parsing and validating HTTP request arguments, with built-in support for popular web frameworks, including Flask, Django, Bottle, Tornado, Pyramid, webapp2, Falcon, and aiohttp.
from flask import Flask
from webargs import fields
from webargs.flaskparser import use_args
app = Flask(__name__)
hello_args = {
'name': fields.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.7 or >= 3.4.
Documentation
Full documentation is available at https://webargs.readthedocs.io/.
Project Links
License
MIT licensed. See the LICENSE file for more details.
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-1.6.0.tar.gz
.
File metadata
- Download URL: webargs-1.6.0.tar.gz
- Upload date:
- Size: 23.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77e6014eb52d8b595c4250141478ec4ca6d26c47b92273ebf89fa4910b7795c4 |
|
MD5 | 08839cd136d41bf2a0aa567babc57e21 |
|
BLAKE2b-256 | 0c3fffa13a1ddb3954012a99ea5f29e0450817552605497ae9b6010c894b5bca |
Provenance
File details
Details for the file webargs-1.6.0-py2.py3-none-any.whl
.
File metadata
- Download URL: webargs-1.6.0-py2.py3-none-any.whl
- Upload date:
- Size: 24.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97d3c5569be17385bf7561aae7ac94992bf81993419a7a3379607620c17ba372 |
|
MD5 | ecbb89dcd3211855ac141dc33e512751 |
|
BLAKE2b-256 | ad825b1812678b2be79f04fb5adf37dc82d553198f929c3525a4ce19905eeb5e |