stdnum.nl.onderwijsnummer

Onderwijsnummer (the Dutch student identification number).

The onderwijsnummers (education number) is very similar to the BSN (Dutch citizen identification number), but is for students without a BSN. It uses a checksum mechanism similar to the BSN.

More information:

>>> validate('1012.22.331')
'101222331'
>>> validate('100252333')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> validate('1012.22.3333')
Traceback (most recent call last):
    ...
InvalidLength: ...
>>> validate('2112.22.337')  # number must start with 10
Traceback (most recent call last):
    ...
InvalidFormat: ...
stdnum.nl.onderwijsnummer.compact(number)

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

stdnum.nl.onderwijsnummer.is_valid(number)

Check if the number is a valid onderwijsnummer.

stdnum.nl.onderwijsnummer.validate(number)

Check if the number is a valid onderwijsnummer. This checks the length and whether the check digit is correct and whether it starts with the right sequence.