Ë
    Ã?ÆiÌ
  ã                  ón   — d Z ddlmZ ddlZddl­ ddlmZ  ej                  d«      Zd
d„Z	d
d„Z
dd	„Zy)aþ  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:

* https://nl.wikipedia.org/wiki/Basisregistratie_Instellingen

>>> 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: ...
é    )ÚannotationsN)Ú*)Úcleanz3^(?P<brin>[0-9]{2}[A-Z]{2})(?P<location>[0-9]{2})?$c                óR   — t        | d«      j                  «       j                  «       S )zˆConvert the number to the minimal representation. This strips the
    number of any valid separators and removes surrounding whitespace.z -.)r   ÚupperÚstrip©Únumbers    úU/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/nl/brin.pyÚcompactr   >   s#   € ô �˜Ó×%Ñ%Ó'×-Ñ-Ó/Ð/ó    c                óŒ   — t        | «      } t        | «      dvr
t        «       ‚t        j	                  | «      }|s
t        «       ‚| S )zCheck if the number is a valid Brun number. This currently does not
    check whether the number points to a registered school.)é   é   )r   ÚlenÚInvalidLengthÚ_brin_reÚsearchÚInvalidFormat)r
   Úmatchs     r   Úvalidater   D   s?   € ô �V‹_€FÜ
ˆ6ƒ{˜&Ñ Ü‹oÐÜ�O‰O˜FÓ#€EÙÜ‹oÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)z+Check if the number is a valid Brun number.F)Úboolr   ÚValidationErrorr	   s    r   Úis_validr   P   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡")r
   ÚstrÚreturnr   )r
   r   r   r   )Ú__doc__Ú
__future__r   ÚreÚstdnum.exceptionsÚstdnum.utilr   Úcompiler   r   r   r   © r   r   ú<module>r%      s:   ðñ(õ8 #ã 	ä Ý ð ˆ2�:‰:ÐLÓM€ó0ó	ôr   