Skip to main content

webargs-sanic provides integration of Webargs with Sanic applications

Project description

webargs-sanic

Sanic integration with Webargs

Build Status Latest Version Python Versions Tests Coverage

webargs is a Python library for parsing and validating HTTP request arguments, with built-in support for popular web frameworks.

webargs-sanic allows you to use it for Sanic apps.

Example Code

from sanic import Sanic

from webargs import fields
from webargs_sanic.sanicparser import use_args

app = Sanic(__name__)

hello_args = {
    'name': fields.Str(required=True)
}

@app.route('/')
@use_args(hello_args)
async def index(args):
    return 'Hello ' + args['name']

Installing

It is easy to do from pip

pip install webargs-sanic

or from sources

git clone git@github.com:EndurantDevs/webtest-sanic.git
cd webtest-sanic
python setup.py install

Running the tests

To be sure everything is fine before installation from sources, just run:

pip -r requirements.txt

and then

python setup.py test

Or

pytest tests/

Project details


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_sanic-0.1.1-py3-none-any.whl (3.6 kB view hashes)

Uploaded Python 3

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