NIP (Numer Identyfikacji Podatkowej, Polish VAT number).
The NIP (Numer Identyfikacji Podatkowej) number consists of 10 digit with a straightforward weighted checksum.
>>> validate('PL 8567346215')
'8567346215'
>>> validate('PL 8567346216') # invalid check digits
Traceback (most recent call last):
...
InvalidChecksum: ...
>>> format('PL 8567346215')
'856-734-62-15'
Calculate the checksum.
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 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.