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': 'test@example.com',
    '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.

Source Distribution

Gladiator-0.6.3.tar.gz (6.1 kB view details)

Uploaded Source

File details

Details for the file Gladiator-0.6.3.tar.gz.

File metadata

  • Download URL: Gladiator-0.6.3.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Gladiator-0.6.3.tar.gz
Algorithm Hash digest
SHA256 7a06b2afad1fe4e423abfc7ee6bc3ed5d69787021505b3ee969684feec1c4768
MD5 17d6fcc2199d08ba76ecf005e0838a3d
BLAKE2b-256 06b7335859f28ae6ca833292d00632f7dfb0853b62cfa7537ba8bbb3b8564edc

See more details on using hashes here.

Supported by

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