CPF (Cadastro de Pessoas Físicas, Brazillian national identifier).
>>> validate('390.533.447-05')
'39053344705'
>>> validate('231.002.999-00')
Traceback (most recent call last):
...
InvalidChecksum: ...
>>> validate('390.533.447=0') # invalid delimiter
Traceback (most recent call last):
...
InvalidFormat: ...
>>> format('23100299900')
'231.002.999-00'
Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.
Reformat the passed number to the standard format.
Checks to see if the number provided is a valid CPF. This checks the length and whether the check digit is correct.
Checks to see if the number provided is a valid CPF. This checks the length and whether the check digit is correct.