# 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:

- https://www.ch.ch/en/value-added-tax-number-und-business-identification-number/
- https://www.uid.admin.ch/

    >>> 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)

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

`stdnum.ch.vat.``format`(number)

  Reformat the number to the standard presentation format.

`stdnum.ch.vat.``is_valid`(number)

  Check if the number is a valid VAT number.

`stdnum.ch.vat.``validate`(number)

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