stdnum.de.vat

Ust ID Nr. (Umsatzsteur Identifikationnummer, German VAT number).

The number is 10 digits long and uses the ISO 7064 Mod 11, 10 check digit algorithm.

>>> compact('DE 136,695 976')
'136695976'
>>> validate('DE136695976')
'136695976'
>>> validate('136695978')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
stdnum.de.vat.compact(number)

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

stdnum.de.vat.is_valid(number)

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

stdnum.de.vat.validate(number)

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