Skip to content
This repository has been archived by the owner on Jan 5, 2022. It is now read-only.
/ standard Public archive

Python validation framework.

License

Notifications You must be signed in to change notification settings

pysigma/standard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sigma.standard

sigma.standard is a python validation framework.
sigma.standard is based on sigma.core.
sigma.standard supports the following validation logics.

  • Type(type)
  • White List(white_list)
  • Black List(black_list)
  • Not None(noneable)
  • String Length(length)
  • Size(size)
  • Regular Expression(match, search)

Example

from sigma.core import Model
from sigma.standard import Field


class User(Model):
    id = Field(type=int, size=(5, 10))
    password = Field(type=str, length=(8, 15))

user = User()
user.id = 20  # raise OverMaxError
user.password = 10  # raise InvalidTypeError

Install

$ pip install sigma.standard

Dependencies

License

sigma is available under the MIT License.