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': '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
Release history Release notifications | RSS feed
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 details)
File details
Details for the file Flask-Gladiator-0.1.tar.gz
.
File metadata
- Download URL: Flask-Gladiator-0.1.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae8901bef77100312037d4b2b262dcc0bab92d8ce4d34b088f5bffd8dd0d2395 |
|
MD5 | 18a8611250462af7690e56dbc9d833c6 |
|
BLAKE2b-256 | 10ea3894bb1d168485b1beeb0e072b3f4ec5fc3e63d80b79df63821b9c37f9a4 |