
    li                     f    d dl mZmZ d dlmZ ddlmZ ddlmZ ddl	m
Z
mZ  G d d	e          Zd
S )    )ListTuple)RegistrantRule   )BaseProvider   )RULES)SBNSBN9c            	       |    e Zd ZdZdee         fdZededee         de	eef         fd            Z
ddedefd	Zd
S )ProviderzGenerates fake SBNs. These are the precursor to the ISBN and are
    largely similar to ISBN-10.

    See https://www.isbn-international.org/content/what-isbn for the
    format of ISBNs. SBNs have no EAN prefix or Registration Group.
    returnc                     t           j        dz
  }|                     d|z            }t          }|                     ||          \  }}||gS )z2Generate the information required to create an SBNr   #)r
   
MAX_LENGTHnumerifyr	   _registrant_publication)selfreg_pub_lenreg_pubrules
registrantpublications         l/var/www/html/Pagina-Ingenieria-Requisitos/venv/lib/python3.11/site-packages/faker/providers/sbn/__init__.py_bodyzProvider._body   sT     >A- }}S;%677 ',"&">">w"N"N
KK((    r   r   c                     |D ]-}|j         | dd         cxk    r|j        k    rn $|j        } n.t          d          | d|         | |d         }}||fS )an  Separate the registration from the publication in a given
        string.
        :param reg_pub: A string of digits representing a registration
            and publication.
        :param rules: A list of RegistrantRules which designate where
            to separate the values in the string.
        :returns: A (registrant, publication) tuple of strings.
        Nz9Registrant/Publication not found in registrant rule list.)minmaxregistrant_length	Exception)r   r   rulereg_lenr   r   s         r   r   z Provider._registrant_publication   s      	Y 	YDx73B3<333348333330 4 WXXX")(7("3WWXX5FK
;&&r   -	separatorc                 z    |                                  \  }}t          ||          }|                    |          S )N)r   r   format)r   r&   r   r   sbns        r   sbn9zProvider.sbn92   s5    "&**,,
K:{++zz)$$$r   N)r%   )__name__
__module____qualname____doc__r   strr   staticmethodr   r   r   r*    r   r   r   r   
   s         )tCy ) ) ) ) ' 'T.5I 'eTWY\T\o ' ' ' \'$% %c %C % % % % % %r   r   N)typingr   r   faker.providers.sbn.rulesr    r   r   r	   r)   r
   r   r   r1   r   r   <module>r5      s            4 4 4 4 4 4                    +% +% +% +% +%| +% +% +% +% +%r   