Integration guide

We provide multiple APIs to help you integrate with PyPI; see API Reference.

Many tools already integrate with PyPI, uploading packages or retrieving data; see the Python Packaging Guide’s tool recommendations.

Migrating to the new PyPI

Warehouse has now replaced the legacy site pypi.python.org. If your site/service used to link or upload to pypi.python.org, it may continue to work due to redirects, but you should use pypi.org instead.

A temporary installation of the legacy PyPI codebase is available at legacy.pypi.org until 30 April 2018, when it will be shut down. It reads from the same database backend and file store as pypi.org. See the Warehouse roadmap for further details.

You should also watch our status page and subscribe to the PyPI announcement list (low-traffic) to find out about future changes.

Here are some tips.

Note

{name} is the name of the package as represented in the URL; for https://pypi.org/project/arrow/, you’d insert arrow wherever you see {name}.

  • If your client correctly follows redirects, you can replace pypi.python.org in your links with pypi.org and everything should just work. For instance, the project detail page https://pypi.org/pypi/{name} (with or without a trailing slash) redirects to https://pypi.org/project/{name}/.
  • Shorter URL: https://pypi.org/p/{name}/ will redirect to https://pypi.org/project/{name}/.
  • All APIs: access is HTTPS-only (changed in October 2017). And pypi.org honors an Accept-Encoding: gzip header, whereas pypi.python.org ignored it.
  • JSON API: https://pypi.org/pypi/{name}/json returns the expected JSON response directly. See JSON API.
  • XML-RPC API: see Changes to Legacy API. Will be deprecated in the future (no specific end date set yet); switch to the RSS or JSON APIs. If you depend on an XML-RPC call that our other APIs do not support, please tell us.
  • Packages/updates RSS feeds: https://pypi.org/pypi?%3Aaction=rss redirects to https://pypi.org/rss/updates.xml, and https://pypi.org/pypi?%3Aaction=packages_rss redirects to https://pypi.org/rss/packages.xml. See Feeds for descriptions. The data differs from the legacy feed data because the new feeds are standards-compliant and fix inaccuracies in the publication date.
  • Documentation upload: Users can no longer use doc_upload in the API to upload documentation ZIP files, separate from packages, to be hosted at pythonhosted.org (discussion).
  • User-Agent Filtering: Some client user agents have been filtered to always use legacy.pypi.org regardless of brownouts or redirects, in order to give them extra time to migrate. Once legacy.pypi.org is shut down on 30 April, all clients will use pypi.org regardless of their User-Agent. See the Warehouse Roadmap for a timeline.
  • Subscribe to the PyPI announcement list (low-traffic).

If you’re a PyPI end user or packager looking to migrate to the new PyPI, please see the official Python Packaging User Guide on migrating to PyPI.