stdnum.br.cpf

CPF (Cadastro de Pessoas Físicas, Brazillian national identifier).

>>> is_valid('390.533.447-05')
True
>>> is_valid('231.002.999-00')
False
>>> compact('390.533.447-05')
'39053344705'
>>> format('23100299900')
'231.002.999-00'
stdnum.br.cpf.compact(number)

Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.

stdnum.br.cpf.format(number)

Reformat the passed number to the standard format.

stdnum.br.cpf.is_valid(number)

Checks to see if the number provided is a valid BSN. This checks the length and whether the check digit is correct.

Previous topic

stdnum.bg.vat

Next topic

stdnum.cy.vat