o
    iJ                     @   s.   d dl Z ddlmZ ddlmZ dddZdS )	    N   )	HTTPError)json2packagehttps://pypi.python.org/pypi/c                 C   sb   | ds	|d }td|| }|jdkrt|j|jdt|jdr,t	|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response r   F/var/www/edux/Edux_v2/venv/lib/python3.10/site-packages/yarg/client.pyr       s   



r   )r   )r   
exceptionsr   packager   r   r   r   r   r   <module>   s   