stdnum.ee.ik

Isikukood (Estonian Personal ID number).

The number consists of 11 digits: the first indicates the gender and century the person was born in, the following 6 digits the birth date, followed by a 3 digit serial and a check digit.

More information:

>>> validate('36805280109')
'36805280109'
>>> validate('36805280108')  # incorrect check digit
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> get_birth_date('36805280109')
datetime.date(1968, 5, 28)
stdnum.ee.ik.calc_check_digit(number: str) str

Calculate the check digit.

stdnum.ee.ik.compact(number: str) str

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

stdnum.ee.ik.get_birth_date(number: str) date

Split the date parts from the number and return the birth date.

stdnum.ee.ik.get_gender(number: str) str

Get the person’s birth gender (‘M’ or ‘F’).

stdnum.ee.ik.is_valid(number: str) bool

Check if the number provided is valid. This checks the length, formatting, embedded date and check digit.

stdnum.ee.ik.validate(number: str) str

Check if the number provided is valid. This checks the length, formatting, embedded date and check digit.