CSenshi / Validator

Easy-to-use, Highly Configurable Python Data Validator. Inspired by Laravel Validator
https://pypi.org/project/validator/
MIT License
46 stars 23 forks source link

New Rule: Octal #91

Closed CSenshi closed 4 years ago

CSenshi commented 4 years ago

Rule Name: Octal

Rule Description: The field under validation must be a octal number

Rule Usage Example:

reqs = {"data" : "73021"}
rule = {"data" : "octal"}
validate(reqs, rule) # True

reqs = {"data" : "0o73021"}
rule = {"data" : "octal"}
validate(reqs, rule) # True

reqs = {"data" : "23489"}
rule = {"data" : "octal"}
validate(reqs, rule) # False, It fails because "8" and "9" are not in octal

Before contributing please review RULES.md (check for duplication), also check CONTRIBUTING.md for more details :100: