API

class disinfect.Mapping(schema)
disinfect.validate(callback, error='Validation error.')
disinfect.sanitize(callback, error='Validation error.')
class disinfect.MultiValueError(message, errors)
class disinfect.MappedValueError(message, errors)
disinfect.Boolean(false_values=None, true_values=None, true_unless_false=False, none_values=None, error='Not a boolean value.')
disinfect.Date(pattern=None, formats=None, error='Invalid date format.', error_before_1900='Year before 1900.', error_after_today='Date in the future.')
disinfect.DateTime(pattern=None, formats=None, error='Invalid date-time format.', error_before_1900='Year before 1900.', error_after_today='Date in the future.')
disinfect.Email(error='Invalid e-mail address.', error_dot='Missing dot in e-mail address.', error_at='Missing at in e-mail address.', check_mx=False)
disinfect.Enum(allowed_values, sanitize=None)
disinfect.Float(min_value=None, max_value=None, error='Not a float.', min_error='Too low.', max_error='Too high.')
disinfect.InstanceOf(class_or_type_or_tuple, error='Not the required type.')
disinfect.Int(min_value=None, max_value=None, error='Not an integer.', min_error='Too low.', max_error='Too high.')
disinfect.List(sanitize=None, split_character=', ')
disinfect.ListOf(test, sanitize=None, split_character=', ', error='One or more errors found.')
disinfect.Regex(pattern, error='Value invalid.')
disinfect.Set(allowed_values, sanitize=None, split_character=', ')
disinfect.String(min_len=1, max_len=150, min_error='Too short.', max_error='Too long.', strip_html=True)
disinfect.Upload(error='Invalid file upload.')
class disinfect.Test(commands, mode='&', error_or='No test has passed.')
AND = '&'
OR = '|'
run(value)
run_and(value)
run_or(value)
class disinfect.Field(name, default=<class 'disinfect.disinfect.Undefined'>, soft=False)
disinfect.test_and_return(callback, return_value, error='Validation error.')