VAT, MWST, TVA, IVA, TPV (Mehrwertsteuernummer, the Swiss VAT number).

The Swiss VAT number is based on the UID but is followed by either “MWST” (Mehrwertsteuer, the German abbreviation for VAT), “TVA” (Taxe sur la valeur ajoutée in French), “IVA” (Imposta sul valore aggiunto in Italian) or “TPV” (Taglia sin la plivalur in Romanian).

This module only supports the “new” format that was introduced in 2011 which completely replaced the “old” 6-digit format in 2014.

More information:

>>> validate('CHE-107.787.577 IVA')
>>> validate('CHE-107.787.578 IVA')
Traceback (most recent call last):
InvalidChecksum: ...
>>> format('CHE107787577IVA')
'CHE-107.787.577 IVA'

Convert the number to the minimal representation. This strips surrounding whitespace and separators.

Reformat the number to the standard presentation format.

Check if the number is a valid VAT number.

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