stdnum.cy.vat

Αριθμός Εγγραφής Φ.Π.Α. (Cypriot VAT number).

The Cypriot Αριθμός Εγγραφής Φ.Π.Α. (VAT) number consists of 9 digits where the last one is a is a letter and functions as a check digit.

>>> compact('CY-10259033P')
'10259033P'
>>> validate('CY-10259033P ')
'10259033P'
>>> validate('CY-10259033Z')  # invalid check digit
Traceback (most recent call last):
    ...
InvalidChecksum: ...
stdnum.cy.vat.calc_check_digit(number)

Calculate the check digit. The number passed should not have the check digit included.

stdnum.cy.vat.compact(number)

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

stdnum.cy.vat.is_valid(number)

Check if the number is a valid VAT number.

stdnum.cy.vat.validate(number)

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