Skip to content

Chainable validators shorthands  #72

Description

@eterey

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions