Text Validators

Most validators work with text. These checkers check against fomatting rules

TextCheck

class xcheck.TextCheck(name, **kwargs)

TextCheck(name[, min_length, max_length, pattern]) TextCheck validates text or elements with string values

Parameters:
  • min_length (integer) – Minimum length of text (default 0)
  • max_length (integer or INF) – Maximum length of text (default INF)
  • pattern – regex that can be used to check the text (default None)

EmailCheck

class xcheck.EmailCheck(name, **kwargs)

EmailCheck(name [allow_none, allow_blank]) Creates a checker specializing in email addresses

Parameters:
  • allow_none (boolean (default True)) – allows NoneType or case-insensitive ‘none’ instead of an email address
  • allow_blank (boolean (default False)) – allows an empty or blank string instead of an email address

URLCheck

class xcheck.URLCheck(name, **kwargs)

UrlCheck(name [, allow_none, allow_blank]) Creates a checker specializing in URLs

Parameters:
  • allow_none (boolean (default True)) – allows NoneType or case-insensitive ‘none’ instead of a URL
  • allow_blank (boolean (default False)) – allows an empty or blank string instead of a URL

This checker uses the :py:mod:urlparse module from the Python distribution.

Table Of Contents

Previous topic

xcheck — XML validation tools

Next topic

Selection Validators

This Page