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
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
Gladiator-0.6.4.tar.gz
(6.2 kB
view details)
File details
Details for the file Gladiator-0.6.4.tar.gz.
File metadata
- Download URL: Gladiator-0.6.4.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43c5efc3f22e6a818643e009fc8b84754fddd605290f03938670f9f605a5351a
|
|
| MD5 |
51cf1d3705a9ef10540a90a2abf89478
|
|
| BLAKE2b-256 |
47519d8b9786945104e5834bae97b3aeac205ca03fc742921625f1c0397b0818
|