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
503 stars 211 forks source link

Any hope for a list of all validation functions? #76

Open KevOrr opened 6 years ago

KevOrr commented 6 years ago

Suppose that we are given a random number and don't know the format. It would be nice if we could try every validate() function in turn, to provide heuristics for what kind of number we're looking at.

arthurdejong commented 6 years ago

That is exactly what https://arthurdejong.org/python-stdnum/check/ does. How this is done can be found here: https://github.com/arthurdejong/python-stdnum/blob/master/online_check/stdnum.wsgi#L100

It does use the internal get_number_modules() function from stdnum.util (and a few others) which is not really part of the public API but if there is enough interest I can make expose some parts via the public API but also see #73 about some broader discussion about enumerating number modules in python-stdnum.