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
495 stars 205 forks source link

Delegate a number verification to an external service #287

Closed jean-martial closed 2 years ago

jean-martial commented 2 years ago

Hello guys!

As you should know, python-stdnum is used by Tryton.

Is there a plan to delegate a number verification to an external service, for example, like this french one?

arthurdejong commented 2 years ago

Hi @jean-martial,

Thanks, I know python-stdnum is used by a few CRM, ERP and financial applications (I know about e.g. Tryton, Odoo and a few commercial solutions).

For some modules a validation function is implemented that can check the number against an online resource. One problem with most of these online resources is that they are pretty subject to change and most are not meant to be queried automatically or in bulk. These checks are never part of the normal validation because that could overload the web services in certain use cases.

The linked check appears to be a VAT number validator. For European VAT numbers there is the stdnum.eu.vat.check_vies() function. That function also returns a dictionary with various properties that are known about the number.

jean-martial commented 2 years ago

Thanks for your answer @arthurdejong.