NIF (Número de identificação fiscal, Portuguese VAT number).
The NIF (Número de identificação fiscal, NIPC, Número de Identificação de Pessoa Colectiva) is used for VAT purposes. It is a 9-digit number with a simple checksum.
>>> validate('PT 501 964 843')
'501964843'
>>> validate('PT 501 964 842') # invalid check digits
Traceback (most recent call last):
...
InvalidChecksum: ...
Calculate the check digit. The number passed should not have the check digit included.
Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.
Checks to see if the number provided is a valid VAT number. This checks the length, formatting and check digit.
Checks to see if the number provided is a valid VAT number. This checks the length, formatting and check digit.