Ë
    Ã?Æi½  ã                  ód   — 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dd	„Zddd
„Zy)uÙ  SIREN (a French company identification number).

The SIREN (SystÃ¨me d'Identification du RÃ©pertoire des Entreprises) is a 9
digit number used to identify French companies. The Luhn checksum is used
to validate the numbers.

>>> compact('552 008 443')
'552008443'
>>> validate('404833048')
'404833048'
>>> validate('404833047')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> to_tva('443 121 975')
'46 443 121 975'
>>> format('404833048')
'404 833 048'
é    )Úannotations)Úluhn)Ú*)Ú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.z .)r   Ústrip©Únumbers    úV/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/fr/siren.pyÚcompactr   6   s   € ô �˜Ó×$Ñ$Ó&Ð&ó    c                ó    — t        | «      } t        | «      s
t        «       ‚t        | «      dk7  r
t	        «       ‚t        j                  | «       | S )zfCheck if the number provided is a valid SIREN. This checks the length,
    formatting and check digit.é	   )r   r   ÚInvalidFormatÚlenÚInvalidLengthr   Úvalidater
   s    r   r   r   <   sB   € ô �V‹_€FÜ�FÔÜ‹oÐÜ
ˆ6ƒ{�aÒÜ‹oÐÜ‡M�M�&ÔØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)z.Check if the number provided is a valid SIREN.F)Úboolr   ÚValidationErrorr
   s    r   Úis_validr   H   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                óV   — dt        t        | «      dz   «      dz  d| v rd| fz  S d| fz  S )zCReturn a TVA that prepends the two extra check digits to the SIREN.z%02d%s%sÚ12éa   ú Ú )Úintr   r
   s    r   Úto_tvar   P   sM   € ð ÜŒG�F‹O˜dÑ"Ó# bÑ(Ø�f‰}ˆØðñ ð à"$Øðñ ð r   c                óR   — t        | «      } |j                  | dd | dd | dd f«      S )z8Reformat the number to the standard presentation format.Né   é   )r   Újoin)r   Ú	separators     r   Úformatr%   Z   s3   € ä�V‹_€FØ�>‰>˜6 " 1˜: v¨a° {°F¸1¸2°JÐ?Ó@Ð@r   N)r   ÚstrÚreturnr&   )r   r&   r'   r   )r   )r   r&   r$   r&   r'   r&   )Ú__doc__Ú
__future__r   Ústdnumr   Ústdnum.exceptionsÚstdnum.utilr   r   r   r   r   r   r%   © r   r   ú<module>r.      s2   ðñ*õ( #å Ü ß 'ó'ó	óóõAr   