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: ...
Calculate the checksum.
Convert the kennitala to the minimal representation. This strips surrounding whitespace and separation dash, and converts it to upper case.
Reformat the passed number to the standard format.
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.
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.