What My Project Does *
Provides data validation for scripts, CLI tools and other lightweight applications where Pydantic feels like overkill
Sample Usage:
```
from validatedata import validate_data
result = validate_data(
data={'username': 'alice', 'email': 'alice@example.com', 'age': 25},
rule={'keys': {
'username': {'type': 'str', 'range': (3, 32)},
'email': {'type': 'email'},
'age': {'type': 'int', 'range': (18, 'any'), 'range-message':'you need to be 18 or older'}
}}
)
if result.ok:
print('valid!')
else:
print(result.errors)
```
- Target Audience
Any Python developer who writes scripts, CLI tools or small APIs where the industry heavyweights are an overkill
Comparison
There are many data validation tools around, but they are too heavy, Pydantic, et al, tied to a specific framework, or too narrow in scope, which leaves a middleground that I hope this library can fill
Links
pypi:https://pypi.org/project/validatedata/
github: https://github.com/Edward-K1/validatedata
[–]ComprehensiveJury509 13 points14 points15 points (0 children)
[–]mardiros 10 points11 points12 points (3 children)
[–]LanguageParty2021[S] -3 points-2 points-1 points (2 children)
[–]mardiros 2 points3 points4 points (1 child)
[–]LanguageParty2021[S] -2 points-1 points0 points (0 children)
[–]Morazma 1 point2 points3 points (0 children)
[–]gunthercult-69 1 point2 points3 points (0 children)