stdnum.nl.bsn

BSN (Burgerservicenummer, Dutch national identification number).

The BSN is a number with up to 9 digits (the leading 0’s are commonly left out) which is used as the Dutch national identification number.

>>> validate('1112.22.333')
'111222333'
>>> validate('1112.52.333')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> validate('1112223334')
Traceback (most recent call last):
    ...
InvalidLength: ...
>>> format('111222333')
'1112.22.333'
stdnum.nl.bsn.checksum(number)

Calculate the checksum over the number. A valid number should have a check digit of 0.

stdnum.nl.bsn.compact(number)

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

stdnum.nl.bsn.format(number)

Reformat the passed number to the standard format.

stdnum.nl.bsn.is_valid(number)

Checks to see if the number provided is a valid BSN. This checks the length and whether the check digit is correct.

stdnum.nl.bsn.validate(number)

Checks to see if the number provided is a valid BSN. This checks the length and whether the check digit is correct.

Previous topic

stdnum.nl.brin

Next topic

stdnum.nl.btw