stdnum.mt.vat

VAT (Maltese VAT number).

The Maltese VAT registration number contains 8 digits and uses a simple weigted checksum.

>>> validate('MT 1167-9112')
'11679112'
>>> validate('1167-9113')  # invalid check digits
Traceback (most recent call last):
    ...
InvalidChecksum: ...
stdnum.mt.vat.checksum(number: str) int

Calculate the checksum.

stdnum.mt.vat.compact(number: str) str

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

stdnum.mt.vat.is_valid(number: str) bool

Check if the number is a valid VAT number.

stdnum.mt.vat.validate(number: str) str

Check if the number is a valid VAT number. This checks the length, formatting and check digit.