Skip to main content

A friendly library for parsing HTTP request arguments, with built-in support for popular web frameworks, including Flask, Django, Bottle, Tornado, Pyramid, webapp2, and Falcon.

Project description

https://badge.fury.io/py/webargs.png https://travis-ci.org/sloria/webargs.png?branch=pypi

Homepage: https://webargs.readthedocs.org/

webargs is a Python library for parsing 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.6 or >= 3.3.

Documentation

Full documentation is available at https://webargs.readthedocs.org/.

License

MIT licensed. See the LICENSE file for more details.

Project details


Release history Release notifications | RSS feed

This version

1.2.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

webargs-1.2.0-py2.py3-none-any.whl (23.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file webargs-1.2.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for webargs-1.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 1777899ef9906fe3688df24e3c2bcd541273a190fe8131c58ca21a2fdbad79b5
MD5 40d87e41a9815fa428e2af99b1255acd
BLAKE2b-256 48bff3e1fd9b32f522fa7d79e387e00b171005ec815e9721b745258db6f7074a

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page