stdnum.ie.vat

VAT (Irish VAT number).

The Irish VAT number consists of 8 digits. The last digit is a check letter, the second digit may be a number, a letter, “+” or “*”.

>>> validate('IE 6433435F')  # pre-2013 format
'6433435F'
>>> validate('IE 6433435OA')  # 2013 format
'6433435OA'
>>> validate('6433435E')  # incorrect check digit
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> validate('8D79739I')  # old style number
'8D79739I'
>>> validate('8?79739J')  # incorrect old style
Traceback (most recent call last):
    ...
InvalidFormat: ...
Traceback (most recent call last):
    ...
InvalidFormat: ...
stdnum.ie.vat.calc_check_digit(number)

Calculate the check digit. The number passed should not have the check digit included.

stdnum.ie.vat.compact(number)

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

stdnum.ie.vat.is_valid(number)

Checks to see if the number provided is a valid VAT number. This checks the length, formatting and check digit.

stdnum.ie.vat.validate(number)

Checks to see if the number provided is a valid VAT number. This checks the length, formatting and check digit.

Previous topic

stdnum.ie.pps

Next topic

stdnum.imei