Ë
    Ã?Æi²
  ã                  óR   — d Z ddlmZ ddlmZ ddl­ ddlmZmZ d
d„Z	d
d„Z
dd„Zy	)a"  Registrikood (Estonian organisation registration code).

All organisations are assigned a unique tax identification code from the
commercial register, from the state register or from the non-profit
associations and foundations register. The code consists of 8 digits.

Commercial company numbers start with a 1, schools and government numbers
with a 7, non-profit organisations with an 8 and foundations with a 9. The
number uses the same check digit algorithm as the Isikukood although that
fact is undocumented.

More information:

* https://ariregister.rik.ee/
* https://mtr.mkm.ee/

>>> validate('12345678')
'12345678'
>>> validate('12345679')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> validate('32345674')
Traceback (most recent call last):
    ...
InvalidComponent: ...
é    )Úannotations)Úcalc_check_digit)Ú*)ÚcleanÚisdigitsc                ó6   — t        | d«      j                  «       S )zˆConvert the number to the minimal representation. This strips the
    number of any valid separators and removes surrounding whitespace.ú )r   Ústrip©Únumbers    ú]/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/ee/registrikood.pyÚcompactr   9   s   € ô �˜Ó×#Ñ#Ó%Ð%ó    c                óÎ   — t        | «      } t        | «      s
t        «       ‚t        | «      dk7  r
t	        «       ‚| d   dvr
t        «       ‚| d   t        | «      k7  r
t        «       ‚| S )úRCheck if the number provided is valid. This checks the length and
    check digit.é   r   Ú1789éÿÿÿÿ)r   r   ÚInvalidFormatÚlenÚInvalidLengthÚInvalidComponentr   ÚInvalidChecksumr   s    r   Úvalidater   ?   sf   € ô �V‹_€FÜ�FÔÜ‹oÐÜ
ˆ6ƒ{�aÒÜ‹oÐØˆa�y˜ÑÜÓ Ð Øˆb�zÔ% fÓ-Ò-ÜÓÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)r   F)Úboolr   ÚValidationErrorr   s    r   Úis_validr   N   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"N)r   ÚstrÚreturnr   )r   r   r    r   )Ú__doc__Ú
__future__r   Ústdnum.ee.ikr   Ústdnum.exceptionsÚstdnum.utilr   r   r   r   r   © r   r   ú<module>r'      s'   ðñ,õ8 #å )Ü ß 'ó&óôr   