HEX
Server: LiteSpeed
System: Linux my-kul-web2054.main-hosting.eu 5.14.0-611.13.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 11 04:57:59 EST 2025 x86_64
User: u665686179 (665686179)
PHP: 8.2.30
Disabled: system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/alt/python311/lib/python3.11/site-packages/validators/i18n/__pycache__/es.cpython-311.pyc
�

E��h'���dZddlmZddlmZdedeeeffd�Zedefd���Zedefd���Zedefd	���Z	edefd
���Z
dS)zSpain.�)�Dict)�	validator�value�number_by_letterc��t|��dkrdS|���}d}|�|d|d��|dd�z}|���o!|d|t	|��dzkS)z&Validate if the doi is a NIF or a NIE.�	F�TRWAGMYFPDXBNJZSQVHLCKEr���)�len�upper�get�isdigit�int)rr�table�numberss    �E/opt/alt/python311/lib/python3.11/site-packages/validators/i18n/es.py�_nif_nie_validationr
s���
�5�z�z�Q����u��K�K�M�M�E�%�E��"�"�5��8�U�1�X�6�6��q��s��C�G��?�?���E��q��U�3�w�<�<�"�3D�-E�!E�E�c��|rt|��dkrdS|���}d}|d}|dd�}|d}|���sdSdtd�t	|��D����dzz
dz}|d	vrt|��|kS|d
vr|||kS|dvr|t|��||hvndS)a�Validate a Spanish CIF.

    Each company in Spain prior to 2008 had a distinct CIF and has been
    discontinued. For more information see [wikipedia.org/cif][1].

    The new replacement is to use NIF for absolutely everything. The issue is
    that there are "types" of NIFs now: company, person [citizen or resident]
    all distinguished by the first character of the DOI. For this reason we
    will continue to call CIFs NIFs, that are used for companies.

    This validator is based on [generadordni.es][2].

    [1]: https://es.wikipedia.org/wiki/C%C3%B3digo_de_identificaci%C3%B3n_fiscal
    [2]: https://generadordni.es/

    Examples:
        >>> es_cif('B25162520')
        True
        >>> es_cif('B25162529')
        ValidationError(func=es_cif, args={'value': 'B25162529'})

    Args:
        value:
            DOI string which is to be validated.

    Returns:
        (Literal[True]): If `value` is a valid DOI string.
        (ValidationError): If `value` is an invalid DOI string.
    rF�
JABCDEFGHIrr
r�
c3��K�|]^\}}|dzdkr?ttttt|��dz������nt|��V��_dS)�rN)�sum�mapr�str)�.0�index�chars   r�	<genexpr>zes_cif.<locals>.<genexpr>Asw����
�
���t�27���a���C��C��S��Y�Y��]�+�+�,�,�-�-�-�S��Y�Y�
�
�
�
�
�
r�ABEH�PSQW�	CDFGJNRUV)r
rrr�	enumerater)rr�	first_chr�doi_body�control�ress      r�es_cifr+s��>��C��J�J�!�O�O��u��K�K�M�M�E��E��a��I��Q�q�S�z�H��A�h�G��������u�
�

�
�
� )��2�2�	
�
�
�
�
�
�

�	
�	�	�C��F����3�x�x�7�"�"��F����S�z�W�$�$�09�[�0H�0H�7�s�3�x�x��s��,�,�,�e�Src�.�dddd�}t||��S)aValidate a Spanish NIF.

    Each entity, be it person or company in Spain has a distinct NIF. Since
    we've designated CIF to be a company NIF, this NIF is only for person.
    For more information see [wikipedia.org/nif][1]. This validator
    is based on [generadordni.es][2].

    [1]: https://es.wikipedia.org/wiki/N%C3%BAmero_de_identificaci%C3%B3n_fiscal
    [2]: https://generadordni.es/

    Examples:
        >>> es_nif('26643189N')
        True
        >>> es_nif('26643189X')
        ValidationError(func=es_nif, args={'value': '26643189X'})

    Args:
        value:
            DOI string which is to be validated.

    Returns:
        (Literal[True]): If `value` is a valid DOI string.
        (ValidationError): If `value` is an invalid DOI string.
    �0)�L�M�K�r�rrs  r�es_nifr3Ps%��4!�s��5�5���u�&6�7�7�7rc�J�dddd�}|r|d|vrt||��SdS)u�Validate a Spanish NIE.

    The NIE is a tax identification number in Spain, known in Spanish
    as the NIE, or more formally the Número de identidad de extranjero.
    For more information see [wikipedia.org/nie][1]. This validator
    is based on [generadordni.es][2].

    [1]: https://es.wikipedia.org/wiki/N%C3%BAmero_de_identidad_de_extranjero
    [2]: https://generadordni.es/

    Examples:
        >>> es_nie('X0095892M')
        True
        >>> es_nie('X0095892X')
        ValidationError(func=es_nie, args={'value': 'X0095892X'})

    Args:
        value:
            DOI string which is to be validated.

    Returns:
        (Literal[True]): If `value` is a valid DOI string.
        (ValidationError): If `value` is an invalid DOI string.
    r-�1�2)�X�Y�ZrFr1r2s  r�es_nier:nsA��4!�s��5�5���<��q��-�-�-�"�5�*:�;�;�;��5rc�\�t|��pt|��pt|��S)a�Validate a Spanish DOI.

    A DOI in spain is all NIF / CIF / NIE / DNI -- a digital ID.
    For more information see [wikipedia.org/doi][1]. This validator
    is based on [generadordni.es][2].

    [1]: https://es.wikipedia.org/wiki/Identificador_de_objeto_digital
    [2]: https://generadordni.es/

    Examples:
        >>> es_doi('X0095892M')
        True
        >>> es_doi('X0095892X')
        ValidationError(func=es_doi, args={'value': 'X0095892X'})

    Args:
        value:
            DOI string which is to be validated.

    Returns:
        (Literal[True]): If `value` is a valid DOI string.
        (ValidationError): If `value` is an invalid DOI string.
    )r:r3r+)rs r�es_doir<�s&��2�%�=�=�:�F�5�M�M�:�V�E�]�]�:rN)�__doc__�typingr�validators.utilsrrrr+r3r:r<�rr�<module>rAs����������'�&�&�&�&�&�
F�s�
F�d�3��8�n�
F�
F�
F�
F��5T�#�5T�5T�5T���5T�p�8�#�8�8�8���8�:��#�������@�;�#�;�;�;���;�;�;r