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?
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.
As for https://pypi.org/ and some other Python repositories:
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.
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.
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?
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.
As for https://pypi.org/ and some other Python repositories:
https://pypi.org/pypi
index (XML RPC URL) is used by thepip 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.
https://pypi.org/simple
is an index, that is used by thepip 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.