stdnum.imsi

IMSI (International Mobile Subscriber Identity).

The IMSI (International Mobile Subscriber Identity) is used to identify mobile phone users (the SIM).

>>> validate('429011234567890')
'429011234567890'
>>> validate('439011234567890')  # unknown MCC
Traceback (most recent call last):
    ...
InvalidComponent: ...
>>> split('429011234567890')
('429', '01', '1234567890')
>>> split('310150123456789')
('310', '150', '123456789')
>>> info('460001234567890')['mcc']
'460'
>>> str(info('460001234567890')['country'])
'China'
stdnum.imsi.compact(number)

Convert the IMSI number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.

stdnum.imsi.info(number)

Return a dictionary of data about the supplied number.

stdnum.imsi.is_valid(number)

Check if the number provided is a valid IMSI.

stdnum.imsi.split(number)

Split the specified IMSI into a Mobile Country Code (MCC), a Mobile Network Code (MNC), a Mobile Station Identification Number (MSIN).

stdnum.imsi.validate(number)

Check if the number provided is a valid IMSI.