Ë
    Ã?Æi?  ã                  óV   — d Z ddlmZ ddl­ ddlmZ dd„ZdZdd„Zdd„Z	dd	„Z
dd
„Zy)aL  CUSIP number (financial security identification number).

CUSIP (Committee on Uniform Securities Identification Procedures) numbers are
used to identify financial securities. CUSIP numbers are a nine-character
alphanumeric code where the first six characters identify the issuer,
followed by two digits that identify and a check digit.

More information:

* https://en.wikipedia.org/wiki/CUSIP
* https://www.cusip.com/

>>> validate('DUS0421C5')
'DUS0421C5'
>>> validate('DUS0421CN')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> to_isin('91324PAE2')
'US91324PAE25'
é    )Úannotations)Ú*)Úcleanc                ó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.ú )r   ÚstripÚupper©Únumbers    úS/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/cusip.pyÚcompactr   0   s#   € ô �˜Ó×#Ñ#Ó%×+Ñ+Ó-Ð-ó    z'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ*@#c                ó†   — dj                  d„ t        | «      D «       «      } t        dt        d„ | D «       «      z
  dz  «      S )z*Calculate the check digits for the number.Ú c              3  óp   K  — | ].  \  }}t        d |dz     t        j                  |«      z  «      –— Œ0 y­w))é   é   r   N)ÚstrÚ	_alphabetÚindex)Ú.0ÚiÚns      r   ú	<genexpr>z#calc_check_digit.<locals>.<genexpr><   s6   è ø€ ò OÙ48°A°qŒˆF�1�q‘5‰MœIŸO™O¨AÓ.Ñ.×/ñOùs   ‚46é
   c              3  ó2   K  — | ]  }t        |«      –— Œ y ­w©N)Úint)r   r   s     r   r   z#calc_check_digit.<locals>.<genexpr>>   s   è ø€ Ò0 Aœ˜QŸÑ0ùs   ‚)ÚjoinÚ	enumerater   Úsumr
   s    r   Úcalc_check_digitr"   9   sG   € ð �W‰Wñ OÜ<EÀfÓ<MôOó O€Fä�”SÑ0¨Ô0Ó0Ñ0°BÑ6Ó7Ð7r   c                óÀ   — t        | «      } t        d„ | D «       «      s
t        «       ‚t        | «      dk7  r
t	        «       ‚t        | dd «      | d   k7  r
t        «       ‚| S )úRCheck if the number provided is valid. This checks the length and
    check digit.c              3  ó,   K  — | ]  }|t         v –— Œ y ­wr   )r   )r   Úxs     r   r   zvalidate.<locals>.<genexpr>E   s   è ø€ Ò. !ˆq”IŒ~Ñ.ùs   ‚é	   Néÿÿÿÿ)r   ÚallÚInvalidFormatÚlenÚInvalidLengthr"   ÚInvalidChecksumr
   s    r   Úvalidater.   A   s\   € ô �V‹_€FÜÑ. vÔ.Ô.Ü‹oÐÜ
ˆ6ƒ{�aÒÜ‹oÐÜ˜˜s ˜Ó$¨¨r©
Ò2ÜÓÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)r$   F)Úboolr.   ÚValidationErrorr
   s    r   Úis_validr2   N   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                ó2   — ddl m} |j                  d| «      S )zConvert the number to an ISIN.r   )ÚisinÚUS)Ústdnumr4   Ú
from_natid)r   r4   s     r   Úto_isinr8   W   s   € åØ�?‰?˜4 Ó(Ð(r   N)r   r   Úreturnr   )r   r   r9   r0   )Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.utilr   r   r   r"   r.   r2   r8   © r   r   ú<module>r?      s5   ðñ(õ, #ä Ý ó.ð 6€	ó8ó
óô)r   