Any interest in a national identification number library?

Dear all,

I “have an itch” that is parsing and validating national identification numbers for natural persons. Legal persons would be cool too but, hey. Maybe one could say “entity identification number”.

I am currently considering to scratch this itch and make it FOSS.

Now, I would like to think that there would be at least some interest in having a common asset along the line with what @kip has done so gallantly and victoriously for CLDR.

Would anyone be interested in someone (read: me) implementing and publishing a library?

Any input regarding overall approach would be greatly appreciated of course.

Kind regards,

Have you investigated if there is such a library in other languages (e.g. Ruby, Python)? Maybe that’s a good measurement of how much in demand such a thing is.

1 Like

That sounds like a ton of work. Be sure you’re really a fan and would still be up for working on it a year from now. IMO that’s your best criteria about whether you should even start.

1 Like

Excellent question!

There is a python library called std-num.

"A Python module to parse, validate and reformat [bold added] standard numbers and codes in different formats. It contains a large collection of number formats.

Basically any number or code that has some validation mechanism available or some common formatting is eligible for inclusion in this library.

That library has 210 types of numbers covered. It seems to have great coverage.

I’m considering modeling an equivalent along the lines of ex_url. It uses NimbleParsec under the hood.

I’m not (yet!) aware of any limitations with NimbleParsec that could be expected to make the effort not feasible.

Thanks for replying!

1 Like

Indeed, there’s basically no end to how much work one could do.

My idea is to start with my own jurisdiction and thereby set a structure to it where others can chip in with their contributions.

Famous last words, but curating this kind of thing is quite appealing to me. You can quote me on that if I have the luxury of “success” (it’s not like Big Blue will flood me with pull requests).

Would be fun to stake a claim, contribute to the community and fight for the correctness of numbers.


Wanting to validate a few tracking numbers, I came upon GitHub - jkeen/tracking_number_data: Shared data for cross platform tracking number detection which is a useful set of data for someone implementing such validation in the language of their choice. The easy to read spec made it easy to work with and the provided tests gave me confidence I had done it right.


That’s a truly useful resource. Thank you for bringing it to my attention!