Ë
    Ã?Æ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	)u1  DNI (Documento Nacional de Identidad, Spanish personal identity codes).

The DNI is a 9 digit number used to identify Spanish citizens. The last
digit is a checksum letter.

Foreign nationals, since 2010 are issued an NIE (NÃºmero de IdentificaciÃ³n
de Extranjeros, Foreigner's Identity Number) instead.

>>> validate('54362315-K')
'54362315K'
>>> validate('54362315Z')  # invalid check digit
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> validate('54362315')  # digit missing
Traceback (most recent call last):
    ...
InvalidLength: ...
é    )Úannotations)Ú*)ÚcleanÚisdigitsc                ó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.z -)r   ÚupperÚstrip©Únumbers    úT/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/es/dni.pyÚcompactr   /   s#   € ô �˜Ó×$Ñ$Ó&×,Ñ,Ó.Ð.ó    c                ó$   — dt        | «      dz     S )zZCalculate the check digit. The number passed should not have the
    check digit included.ÚTRWAGMYFPDXBNJZSQVHLCKEé   )Úintr
   s    r   Úcalc_check_digitr   5   s   € ð %¤S¨£[°2Ñ%5Ñ6Ð6r   c                ó¸   — t        | «      } t        | dd «      s
t        «       ‚t        | «      dk7  r
t	        «       ‚t        | dd «      | d   k7  r
t        «       ‚| S )úkCheck if the number provided is a valid DNI number. This checks the
    length, formatting and check digit.Néÿÿÿÿé	   )r   r   ÚInvalidFormatÚlenÚInvalidLengthr   ÚInvalidChecksumr
   s    r   Úvalidater   ;   s\   € ô �V‹_€FÜ�F˜3˜B�KÔ Ü‹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_validr    H   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"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)   ðñ*õ( #ä ß 'ó/ó7ó
ôr   