stdnum.ch.vat

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')
'CHE107787577IVA'
>>> validate('CHE-107.787.578 IVA')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> format('CHE107787577IVA')
'CHE-107.787.577 IVA'
stdnum.ch.vat.compact(number: str) str

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

stdnum.ch.vat.format(number: str) str

Reformat the number to the standard presentation format.

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

Check if the number is a valid VAT number.

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

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