PyPI index vs simple index

Question:

I’ve seen mention both an index and a simple index in relation to PyPI, an example is here in the devpi documentation. Is there some difference between the two indexes? Are they the same or do they have different access controls or functions for example?

Asked By: Yep_It's_Me

||

Answers:

The “simple” index protocol is read-only, intended for automated use, and is defined in PEP 503. Other protocols with more functionality may be defined by particular repository servers, but are probably only usable with that server’s own tools.

Answered By: mhsmith

As for https://pypi.org/ and some other Python repositories:

  1. https://pypi.org/pypi index (XML RPC URL) is used by the pip search command.
    For example:
pip search --index https://pypi.org/pypi twine

https://pypi.org/ deprecated this feature in their repo. But you can still use it in private repositories.

  1. https://pypi.org/simple is an index, that is used by the pip install command.
    For example:
pip install --index-url https://pypi.org/simple twine

To assess simple via web, add a slash at the end of https://pypi.org/simple/ if there is no automatic redirect.

By the way, --index has a corresponding PIP_INDEX environment variable and --index-url has a corresponding PIP_INDEX_URL variable.

Answered By: t7e
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.