stdnum.vatin

VATIN (International value added tax identification number)

The number VAT identification number (VATIN) is an identifier used in many countries. It starts with an ISO 3166-1 alpha-2 (2 letters) country code (except for Greece, which uses EL, instead of GR) and is followed by the country-specific the identifier.

This module supports all VAT numbers that are supported in python-stdnum.

More information:

>>> validate('FR 40 303 265 045')
'FR40303265045'
>>> validate('DE136,695 976')
'DE136695976'
>>> validate('BR16.727.230/0001-97')
'BR16727230000197'
>>> validate('FR 40 303')
Traceback (most recent call last):
    ...
InvalidLength: ...
>>> validate('XX')
Traceback (most recent call last):
    ...
InvalidComponent: ...
stdnum.vatin.compact(number)

Convert the number to the minimal representation.

stdnum.vatin.is_valid(number)

Check if the number is a valid VAT number.

stdnum.vatin.validate(number)

Check if the number is a valid VAT number.

This performs the country-specific check for the number.