# stdnum.gr.vat

FPA, ΦΠΑ, ΑΦΜ (Αριθμός Φορολογικού Μητρώου, the Greek VAT number).

The FPA is a 9-digit number with a simple checksum.

    >>> compact('GR 23456783')
    '023456783'
    >>> validate('EL 094259216 ')
    '094259216'
    >>> validate('EL 123456781')
    Traceback (most recent call last):
        ...
    InvalidChecksum: ...

stdnum.gr.vat.calc_check_digit(number: str) → str

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

stdnum.gr.vat.compact(number: str) → str

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

stdnum.gr.vat.is_valid(number: str) → bool

  Check if the number is a valid VAT number.

stdnum.gr.vat.validate(number: str) → str

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