Ë
    Ã?Æim
  ã                  óZ   — d Z ddlmZ ddl­ ddlmZ ddlmZmZ dd„Z	dd„Z
dd„Zdd	„Zy
)a»  ISNI (International Standard Name Identifier).

The International Standard Name Identifier (ISNI) is used to identify
contributors to media content such as books, television programmes, and
newspaper articles. The number consists of 16 digits where the last character
is a check digit.

More information:

* https://en.wikipedia.org/wiki/International_Standard_Name_Identifier
* https://isni.org/

>>> validate('0000 0001 2281 955X')
'000000012281955X'
>>> validate('0000 0001 1111 955X')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> validate('0000 0001 2281')
Traceback (most recent call last):
    ...
InvalidLength: ...
>>> format('000000012281955X')
'0000 0001 2281 955X'
é    )Úannotations)Ú*)Úmod_11_2)ÚcleanÚisdigitsc                óR   — t        | d«      j                  «       j                  «       S )z‹Convert the ISNI to the minimal representation. This strips the number
    of any valid ISNI separators and removes surrounding whitespace.z -)r   ÚstripÚupper©Únumbers    úR/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/isni.pyÚcompactr   5   s#   € ô �˜Ó×$Ñ$Ó&×,Ñ,Ó.Ð.ó    c                ó¦   — t        | «      } t        | dd «      s
t        «       ‚t        | «      dk7  r
t	        «       ‚t        j                  | «       | S )zgCheck if the number is a valid ISNI. This checks the length and
    whether the check digit is correct.Néÿÿÿÿé   )r   r   ÚInvalidFormatÚlenÚInvalidLengthr   Úvalidater   s    r   r   r   ;   sJ   € ô �V‹_€FÜ�F˜3˜B�KÔ Ü‹oÐÜ
ˆ6ƒ{�bÒÜ‹oÐÜ×Ñ�fÔØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)z-Check if the number provided is a valid ISNI.F)Úboolr   ÚValidationErrorr   s    r   Úis_validr   G   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                óZ   — t        | «      } dj                  | dd | dd | dd | dd f«      S )z8Reformat the number to the standard presentation format.ú Né   é   é   r   )r   Újoinr   s    r   Úformatr!   O   s;   € ä�V‹_€FØ�8‰8�V˜B˜Q�Z ¨¨! ¨f°Q°r¨l¸FÀ2Àb¸MÐJÓKÐKr   N)r   ÚstrÚreturnr"   )r   r"   r#   r   )Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.iso7064r   Ústdnum.utilr   r   r   r   r   r!   © r   r   ú<module>r*      s-   ðñ(õ4 #ä Ý #ß 'ó/ó	óôLr   