Onderwijsnummer (Dutch school number).
The onderwijsnummers (school number) is very similar to the BSN (Dutch national identification number) but for students without a BSN. It uses a small variation of the BSN checksum.
>>> 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: ...
Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.
Checks to see if the number provided is a valid onderwijsnummer. This checks the length and whether the check digit is correct and whether it starts with the right sequence.
Checks to see if the number provided is a valid onderwijsnummer. This checks the length and whether the check digit is correct and whether it starts with the right sequence.