Ë
    Ã?Æi=
  ã                  óZ   — 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y
)u¥  NIFp (NumÃ©ro d'Identification Fiscale Permanent, Guinea tax number).

This number consists of 9 digits, usually separated into three groups using
hyphens to make it easier to read. The first eight digits are assigned in a
pseudorandom manner. The last digit is the check digit.

More information:

* https://dgi.gov.gn/wp-content/uploads/2022/09/N%C2%B0-12-Cahier-de-Charges-NIF-p.pdf

>>> validate('693770885')
'693770885'
>>> validate('693-770-885')
'693770885'
>>> validate('12345')
Traceback (most recent call last):
    ...
InvalidLength: ...
>>> validate('693770880')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> format('693770885')
'693-770-885'
é    )Ú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    úU/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/gn/nifp.pyÚcompactr   6   s   € ô �˜Ó×$Ñ$Ó&Ð&ó    c                ó    — t        | «      } t        | «      dk7  r
t        «       ‚t        | «      s
t	        «       ‚t        j                  | «       | S )zpCheck if the number is a valid Guinea NIFp number.

    This checks the length, formatting and check digit.
    é	   )r   ÚlenÚInvalidLengthr   ÚInvalidFormatr   Úvalidater
   s    r   r   r   ?   sB   € ô
 �V‹_€FÜ
ˆ6ƒ{�aÒÜ‹oÐÜ�FÔÜ‹oÐÜ‡M�M�&ÔØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)z2Check if the number is a valid Guinea NIFp number.F)Úboolr   ÚValidationErrorr
   s    r   Úis_validr   M   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                óR   — t        | «      } dj                  | dd | dd | dd g«      S )z8Reformat the number to the standard presentation format.ú-Né   éýÿÿÿ)r   Újoinr
   s    r   Úformatr   U   s3   € ä�V‹_€FØ�8‰8�V˜B˜Q�Z ¨¨" ¨v°b°c¨{Ð;Ó<Ð<r   N)r   ÚstrÚreturnr   )r   r   r    r   )Ú__doc__Ú
__future__r   Ústdnumr   Ústdnum.exceptionsÚstdnum.utilr   r   r   r   r   r   © r   r   ú<module>r'      s,   ðñ*õ4 #å Ü ß 'ó'óóô=r   