Brin number (Dutch number for schools).

The Brin (Basis Registratie 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:

>>> validate('05 KO')
>>> validate('07NU 00')
>>> validate('12KB1')
Traceback (most recent call last):
InvalidLength: ...
>>> validate('30AJ0A')  # location code has letter
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.

Check if the number is a valid Brun number.

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