
    fJ                     ,    d dl Z ddlmZ ddlmZ ddZy)    N   )	HTTPError)json2packagec                 t   |j                  d      s|dz   }t        j                  dj                  ||             }|j                  dk\  r!t        |j                  |j                        t        |j                  d      r#t        |j                  j                               S t        |j                        S )aC  
    Constructs a request to the PyPI server and returns a
    :class:`yarg.package.Package`.

    :param package_name: case sensitive name of the package on the PyPI server.
    :param pypi_server: (option) URL to the PyPI server.

        >>> import yarg
        >>> package = yarg.get('yarg')
        <Package yarg>
    /z{0}{1}/jsoni,  )status_codereasondecode)endswithrequestsgetformatr   r   r	   hasattrcontentr   r
   )package_namepypi_serverresponses      F/var/www/cvtools/html/venv/lib/python3.12/site-packages/yarg/client.pyr   r       s     $!C'||M001=? @Hs"H$8$8'0 	0x*H,,33566H,,--    )zhttps://pypi.python.org/pypi/)r   
exceptionsr   packager   r    r   r   <module>r      s   4  ! !.r   