IMEI (International Mobile Equipment Identity).

The IMEI is used to identify mobile phones. An IMEI is 14, 15 (when the check digit is included) or 16 digits (IMEISV) long. The check digit is validated using the Luhn algorithm.

More information:

>>> validate('35686800-004141-20')
>>> validate('35-417803-685978-1')
Traceback (most recent call last):
InvalidChecksum: ...
>>> compact('35686800-004141-20')
>>> format('354178036859789')
>>> format('35686800-004141', add_check_digit=True)
>>> imei_type('35686800-004141-20')
>>> split('35686800-004141')
('35686800', '004141', '')

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

stdnum.imei.format(number, separator='-', add_check_digit=False)

Reformat the number to the standard presentation format.


Check the passed number and return ‘IMEI’, ‘IMEISV’ or None (for invalid) for checking the type of number passed.


Check if the number provided is a valid IMEI (or IMEISV) number.


Split the number into a Type Allocation Code (TAC), serial number and either the checksum (for IMEI) or the software version number (for IMEISV).


Check if the number provided is a valid IMEI (or IMEISV) number.