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

Error parsing imsi using NUMDB #68

Closed weberxw closed 6 years ago

weberxw commented 6 years ago

stdnum.numdb.get('imsi').split('502152100145324') ['502', '15', '100145324']

arthurdejong commented 6 years ago

The numdb module is more meant for internal python-stdnum use and not part of the publicly documented API. To do IMSI validation see https://arthurdejong.org/python-stdnum/doc/stdnum.imsi.html I also do not see what the error is in the example you provided. Are you saying that 502152100145324 is not a valid IMSI?

weberxw commented 6 years ago

Hi, thanks for the answer.

The error I described is that this IMSI 502152100145324 has MCC 502 MNC 152 and the numdb split returns 502 - 15 Got it?

arthurdejong commented 6 years ago

I understand now. Thanks for pointing this out, fixed in e6739be.