Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chainable validators shorthands #72

Open
eterey opened this issue Nov 8, 2020 · 0 comments
Open

Chainable validators shorthands #72

eterey opened this issue Nov 8, 2020 · 0 comments

Comments

@eterey
Copy link
Owner

eterey commented Nov 8, 2020

Create chainable shorthands for pyvalid's validators. It may be useful for cases, when we just need to quickly verify some value without preparing comprehensive validators.

Examples:

from pyvalid import check

check('Some_Str0ng_P@ssword!').all().min_length(6).max_length(64).contains_special_symbols(2).contains_numbers(1).exec()
# Returns `True`

check('WeakPass').all().min_length(6).max_length(64).contains_special_symbols(2).contains_numbers(1).exec()
# Returns `False`

check('12345').is_postal_code('gb').exec()
# Returns `False`

check('SW1W 0NY').is_postal_code('gb').exec()
# Returns `True`

The naming and style can be changed thought.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant