Ë
    Ã?Æib  ã                  ó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
)up  CPF (Cadastro de Pessoas FÃ­sicas, Brazilian national identifier).

The Cadastro de Pessoas FÃ­sicas is the Brazilian identification number
assigned to individuals for tax purposes. The number consists of 11 digits
and includes two check digits.

More information:

* https://en.wikipedia.org/wiki/Cadastro_de_Pessoas_FÃ­sicas

>>> validate('390.533.447-05')
'39053344705'
>>> validate('231.002.999-00')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> validate('390.533.447=0')  # invalid delimiter
Traceback (most recent call last):
    ...
InvalidFormat: ...
>>> format('23100299900')
'231.002.999-00'
é    )Ú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.z -.)r   Ústrip©Únumbers    úT/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/br/cpf.pyÚcompactr   3   s   € ô �˜Ó×%Ñ%Ó'Ð'ó    c                ó¾   ‡ — t        ˆ fd„t        d«      D «       «      }d|z
  dz  dz  }t        ˆ fd„t        d«      D «       «      d|z  z   }d|z
  dz  dz  }d||fz  S )z*Calculate the check digits for the number.c              3  óF   •K  — | ]  }d |z
  t        ‰|   «      z  –— Œ y­w)é
   N©Úint©Ú.0Úir
   s     €r   ú	<genexpr>z%_calc_check_digits.<locals>.<genexpr>;   ó"   øè ø€ Ò9¨1ˆb�1‰fœ˜F 1™I›Õ&Ñ9ùó   ƒ!é	   é   r   c              3  óF   •K  — | ]  }d |z
  t        ‰|   «      z  –— Œ y­w)r   Nr   r   s     €r   r   z%_calc_check_digits.<locals>.<genexpr>=   r   r   é   z%d%d)ÚsumÚrange)r
   Úd1Úd2s   `  r   Ú_calc_check_digitsr!   9   sg   ø€ ä	Ó9´°a³Ô9Ó	9€BØ
ˆr‰'�R‰˜"Ñ	€BÜ	Ó9´°a³Ô9Ó	9¸AÀ¹FÑ	B€BØ
ˆr‰'�R‰˜"Ñ	€BØ�R˜�HÑÐr   c                óÈ   — t        | «      } t        | «      rt        | «      dk  r
t        «       ‚t	        | «      dk7  r
t        «       ‚t        | «      | dd k7  r
t        «       ‚| S )zfCheck if the number is a valid CPF. This checks the length and whether
    the check digit is correct.r   r   éþÿÿÿN)r   r   r   ÚInvalidFormatÚlenÚInvalidLengthr!   ÚInvalidChecksumr	   s    r   Úvalidater(   B   s]   € ô �V‹_€FÜ�FÔœs 6›{¨aÒ/Ü‹oÐÜ
ˆ6ƒ{�bÒÜ‹oÐÜ˜&Ó! V¨B¨C [Ò0ÜÓÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)z#Check if the number is a valid CPF.F)Úboolr(   ÚValidationErrorr	   s    r   Úis_validr,   O   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                óX   — t        | «      } | dd dz   | dd z   dz   | dd z   dz   | dd z   S )z8Reformat the number to the standard presentation format.Né   ú.é   r#   ú-)r   r	   s    r   Úformatr2   W   sG   € ä�V‹_€FØ�"�1ˆ:˜Ñ˜f Q q˜kÑ)¨CÑ/°&¸¸2°,Ñ>ÀÑDÀvÈbÈcÀ{ÑRÐRr   N)r
   ÚstrÚreturnr3   )r
   r3   r4   r*   )Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.utilr   r   r   r!   r(   r,   r2   © r   r   ú<module>r:      s/   ðñ*õ0 #ä ß 'ó(óó
óôSr   