stdnum.no.fodselsnummer

Fødselsnummer (Norwegian birth number, the national identity number).

The Fødselsnummer is an eleven-digit number that is built up of the date of birth of the person, a serial number and two check digits.

More information:

>>> validate('151086 95088')
'15108695088'
>>> get_gender('151086-95088')
'F'
>>> validate('15108695077')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> format('15108695077')
'151086 95077'
stdnum.no.fodselsnummer.calc_check_digit1(number)

Calculate the first check digit for the number.

stdnum.no.fodselsnummer.calc_check_digit2(number)

Calculate the second check digit for the number.

stdnum.no.fodselsnummer.compact(number)

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

stdnum.no.fodselsnummer.format(number)

Reformat the number to the standard presentation format.

stdnum.no.fodselsnummer.get_birth_date(number)

Determine and return the birth date.

stdnum.no.fodselsnummer.get_gender(number)

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

stdnum.no.fodselsnummer.is_valid(number)

Check if the number is a valid birth number.

stdnum.no.fodselsnummer.validate(number)

Check if the number is a valid birth number.