Skip to main content

Gladiator is a Data Validation Framework for Python3 (Flask Plugin)

Project description

Validation Framework for Python3 (Flask Extension)

A quick example

A registration form accepts this data structure:

valid_test_data = {
    'email': '',
    'pw': 'password123',
    'name': 'Test Username',
    'birth_year': 1984

The validation process can be:

import gladiator as gl

registration_form_validator = (
    ('email', gl.required, gl.format_email),
    ('pw', gl.required, gl.length_min(5)),
    ('name', gl.required, gl.type_(str)),
    ('birth_year', gl.required, gl.type_(int), gl.value_max(2014 - 18))

result = gl.validate(registration_form_validator, valid_test_data)
assert result.success is True

Project details

Release history Release notifications | RSS feed

This version


Download files

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

Source Distribution

Flask-Gladiator-0.1.tar.gz (2.5 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page