Ë
    Ã?Æi.  ã                  óN   — 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
y	)u  NIF, sometimes N.I.F. (NumÃ©ro d'Identification Fiscale, Algeria tax number).

The NIF was adopted by the Algerian tax authorities on 2006, replacing the NIS
number.

The NIF applies to physical persons, legal persons, legal entities,
administrative entities, local branches for foreign companies, associations,
professional organisations, etc.

The NIF consists of 15 digits, but sometimes it can be 20 digits long in order
to represent branches or secondary establishments.

More information:

* http://www.jecreemonentreprise.dz/index.php?option=com_content&view=article&id=612&Itemid=463&lang=fr
* https://www.mf.gov.dz/index.php/fr/fiscalite
* https://cnrcinfo.cnrc.dz/numero-didentification-fiscale-nif/
* https://nifenligne.mfdgi.gov.dz/
* http://nif.mfdgi.gov.dz/nif.asp

>>> validate('416001000000007')
'416001000000007'
>>> validate('408 020 000 150 039')
'408020000150039'
>>> validate('41201600000606600001')
'41201600000606600001'
>>> validate('000 216 001 808 337 13010')
'00021600180833713010'
>>> validate('12345')
Traceback (most recent call last):
    ...
InvalidLength: ...
>>> validate('X1600100000000V')
Traceback (most recent call last):
    ...
InvalidFormat: ...
>>> format('408 020 000 150 039')
'408020000150039'
>>> format('000 216 001 808 337 13010')
'00021600180833713010'
é    )Úannotations)Ú*)ÚcleanÚisdigitsc                ó   — t        | d«      S )z�Convert the number to the minimal representation.

    This strips the number of any valid separators, removes surrounding
    whitespace.
    ú )r   ©Únumbers    úT/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/dz/nif.pyÚcompactr   E   s   € ô �˜ÓÐó    c                ót   — t        | «      } t        | «      dvr
t        «       ‚t        | «      s
t	        «       ‚| S )zcCheck if the number is a valid Algeria NIF number.

    This checks the length and formatting.
    )é   é   )r   ÚlenÚInvalidLengthr   ÚInvalidFormatr	   s    r   Úvalidater   N   s6   € ô
 �V‹_€FÜ
ˆ6ƒ{˜(Ñ"Ü‹oÐÜ�FÔÜ‹oÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)z2Check if the number is a valid Algeria NIF number.F)Úboolr   ÚValidationErrorr	   s    r   Úis_validr   [   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                ó   — t        | «      S )z8Reformat the number to the standard presentation format.)r   r	   s    r   Úformatr   c   s   € ä�6‹?Ðr   N)r
   ÚstrÚreturnr   )r
   r   r   r   )Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.utilr   r   r   r   r   r   © r   r   ú<module>r"      s*   ðñ*(õT #ä ß 'óó
óôr   