def get_package_info ( package ) : url = 'https://pypi.python.org/pypi/{}/json' . format ( package ) r = requests . get ( url ) r . raise_for_status ( ) return r . json ( )
retrieving data from apis with python
Gets the PyPI information for a given package .
def get_package_info(package):
    """Gets the PyPI information for a given package."""
    url = 'https://pypi.python.org/pypi/{}/json'.format(package)
    r = requests.get(url)
    r.raise_for_status()
    return r.json()