NRIC No. (Malaysian National Registration Identity Card Number).

The NRIC No. is the unique identifier for issued to Malaysian citizens and permanent residents.

The number consist of 12 digits in three sections. The first 6 digits represent the birth date, followed by two digits represeting the birth place and finally four digits. The gender of a person can be derived from the last digit: odd numbers for males and even numbers for females.

>>> validate('770305-02-1234')
>>> validate('771305-02-1234')  # invalid date
Traceback (most recent call last):
InvalidComponent: ...
>>> validate('770305-17-1234')  # unknown birth place code
Traceback (most recent call last):
InvalidComponent: ...
>>> format('770305021234')

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

Reformat the number to the standard presentation format.

Split the date parts from the number and return the birth date. Note that in some cases it may return the registration date instead of the birth date and it may be a century off.

Use the number to look up the place of birth of the person. This can either be a state or federal territory within Malaysia or a country outside of Malaysia.

Check if the number is a valid NRIC number.

Check if the number is a valid NRIC number. This checks the length, formatting and birth date and place.