stdnum.is_.kennitala

Kennitala (Icelandic personal and organisation identity code).

Module for handling Icelandic personal and organisation identity codes (kennitala).

>>> validate('450401-3150')  # organisation
'4504013150'
>>> validate('120174-3399')  # individual
'1201743399'
>>> validate('530575-0299')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> validate('320174-3399')
Traceback (most recent call last):
    ...
InvalidComponent: ...
>>> format('1201743399')
'120174-3399'
Traceback (most recent call last):
    ...
InvalidComponent: ...
stdnum.is_.kennitala.checksum(number)

Calculate the checksum.

stdnum.is_.kennitala.compact(number)

Convert the kennitala to the minimal representation. This strips surrounding whitespace and separation dash, and converts it to upper case.

stdnum.is_.kennitala.format(number)

Reformat the passed number to the standard format.

stdnum.is_.kennitala.is_valid(number)

Checks to see if the number provided is a valid HETU. It checks the format, whether a valid date is given and whether the check digit is correct.

stdnum.is_.kennitala.validate(number)

Checks to see if the number provided is a valid kennitala. It checks the format, whether a valid date is given and whether the check digit is correct.

Previous topic

stdnum.imsi

Next topic

stdnum.is_.vsk