stdnum.nl.brin

BRIN number (the Dutch school identification number).

The BRIN (Basisregistratie Instellingen) is a number to identify schools and related institutions. The number consists of four alphanumeric characters, sometimes extended with two digits to indicate the site (this complete code is called the vestigingsnummer).

The register of these numbers can be downloaded from: https://www.duo.nl/open_onderwijsdata/databestanden/

More information:

>>> validate('05 KO')
'05KO'
>>> validate('07NU 00')
'07NU00'
>>> validate('12KB1')
Traceback (most recent call last):
    ...
InvalidLength: ...
>>> validate('30AJ0A')  # location code has letter
Traceback (most recent call last):
    ...
InvalidFormat: ...
stdnum.nl.brin.compact(number)

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

stdnum.nl.brin.is_valid(number)

Check if the number is a valid Brun number.

stdnum.nl.brin.validate(number)

Check if the number is a valid Brun number. This currently does not check whether the number points to a registered school.