arthurdejong / python-stdnum

A Python library to provide functions to handle, parse and validate standard numbers.
https://arthurdejong.org/python-stdnum/
GNU Lesser General Public License v2.1
484 stars 203 forks source link

Correct French VATIN raising error #434

Closed JffCosta closed 1 week ago

JffCosta commented 1 month ago

Correct french vat according to https://ec.europa.eu/taxation_customs/tin/#/check-tin is raising an error. The vat is: FR3039235943079

arthurdejong commented 1 week ago

That service only has very limited validation of the structure of the number (probably limited to a regex). The [EU VIES validation](url) does mark the supplied number as invalid.

The python-stdnum module tries to do extensive checks based on the structure of the number. In case of the French VAT number, it may be a SIREN (which use a Luhn check digit) prefixed with mod 97 or mod 11 check digits. This is not captured in a regex-like check.