Skip to content

New PyPi Warehouse launched -> Change PyPi URL for JSON API Call #4

Closed
@anx-ckreuzberger

Description

@anx-ckreuzberger

From https://pythoninsider.blogspot.co.at/2018/04/new-pypi-launched-legacy-pypi-shutting.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+PythonInsider+(Python+Insider)

If your site/service links to or uses pypi.python.org, you should start using pypi.org instead: https://warehouse.readthedocs.io/api-reference/integration-guide/#migrating-to-the-new-pypi

Current Code:

pypi_url = 'https://pypi.python.org/pypi'
if version:
package_url = '%s/%s/%s/json' % (pypi_url, package_name, version, )
else:
package_url = '%s/%s/json' % (pypi_url, package_name, )

New URL is https://pypi.org/pypi/%s/%s/json, so the code should look like:

 pypi_url = 'https://pypi.org/pypi' 

 if version: 
     package_url = '%s/%s/%s/json' % (pypi_url, package_name, version, ) 
 else: 
     package_url = '%s/%s/json' % (pypi_url, package_name, ) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions