Skip to main content

Gladiator is a Data Validation Framework for Python3

Project description

Validation Framework for Python3

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

Download files

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

Files for Gladiator, version 0.7.0
Filename, size File type Python version Upload date Hashes
Filename, size Gladiator-0.7.0.tar.gz (6.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page