Welcome to Qval’s documentation!

Qval is a query parameters validation library designed to be used in small projects that require a lot of repetitive parameter validation. In contrast with DRF’s Validators (and other serialization abstractions), Qval requires almost no boilerplate. It is built using context managers and mainly targets Django and Django Rest Framework (DRF), but also supports Flask and Falcon.

Qval can validate incoming query parameters, convert them to python objects and automatically report errors to the client.

Get started

In order to use Qval in your project, install it with pip:

$ pip install qval

The usage is as simple as:

>>> from qval import validate
>>> with validate({"integer": "10"}, integer=int) as p:
...     print(type(p.integer) is int, p.integer)
True 10

For more verbose and clear examples refer to Basic usage and examples in the github repository.