Ë
    Ã?Æiû  ã                  óV   — d 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	„Zy
)uu  NIF (NumÃ©ro d'Immatriculation Fiscale, French tax identification number).

The NIF (NumÃ©ro d'Immatriculation Fiscale or NumÃ©ro d'Identification Fiscale)
also known as numÃ©ro fiscal de rÃ©fÃ©rence or SPI (Simplification des
ProcÃ©dures d'Identification) is a 13-digit number issued by the French tax
authorities to people for tax reporting purposes.

More information:

* https://ec.europa.eu/taxation_customs/tin/tinByCountry.html
* https://fr.wikipedia.org/wiki/NumÃ©ro_d%27Immatriculation_Fiscale#France

>>> validate('3023217600053')
'3023217600053'
>>> validate('3023217600054')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> validate('070198776543')
Traceback (most recent call last):
    ...
InvalidLength: ...
>>> validate('9701987765432')
Traceback (most recent call last):
    ...
InvalidComponent: ...
>>> format('3023217600053')
'30 23 217 600 053'
é    )Úannotations)Ú*)Ú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    úT/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/fr/nif.pyÚcompactr   9   s   € ô �˜Ó×#Ñ#Ó%Ð%ó    c                ó*   — dt        | dd «      dz  z  S )z*Calculate the check digits for the number.z%03dNé
   iÿ  )Úintr
   s    r   Úcalc_check_digitsr   ?   s   € à”S˜  ˜Ó%¨Ñ+Ñ,Ð,r   c                óÎ   — t        | «      } t        | «      s
t        «       ‚| d   dvr
t        «       ‚t	        | «      dk7  r
t        «       ‚t        | «      | dd k7  r
t        «       ‚| S )ú,Check if the number provided is a valid NIF.r   )Ú0Ú1Ú2Ú3é   éýÿÿÿN)r   r   ÚInvalidFormatÚInvalidComponentÚlenÚInvalidLengthr   ÚInvalidChecksumr
   s    r   Úvalidater    D   sf   € ä�V‹_€FÜ�FÔÜ‹oÐØˆa�yÐ,Ñ,ÜÓ Ð Ü
ˆ6ƒ{�bÒÜ‹oÐÜ˜Ó  F¨2¨3 KÒ/ÜÓÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)r   F)Úboolr    ÚValidationErrorr
   s    r   Úis_validr$   R   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c           	     ób   — t        | «      } dj                  | dd | dd | dd | dd | dd f«      S )z8Reformat the number to the standard presentation format.r   Né   é   é   r   )r   Újoinr
   s    r   Úformatr*   Z   sJ   € ä�V‹_€FØ�8‰8�V˜B˜Q�Z ¨¨! ¨f°Q°q¨kØ˜A˜b�\ 6¨"¨# ;ð0ó 1ð 1r   N)r   ÚstrÚreturnr+   )r   r+   r,   r"   )Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.utilr   r   r   r   r    r$   r*   © r   r   ú<module>r2      s.   ðñ*õ< #ä ß 'ó&ó-ó
óô1r   