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('684131 52112')
'68413152112'
>>> get_gender('684131 52112')
'M'
>>> validate('684131 52123')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> format('68413152112')
'684131 52112'
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_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.