LinuxCommandLibrary

pip-index

Manage Python package indexes

TLDR

List all available versions of a package

$ pip index versions [package]
copy

List versions from a specific index
$ pip index versions [package] --index-url [https://test.pypi.org/simple/]
copy

Include pre-release versions
$ pip index versions [package] --pre
copy

Include an additional index
$ pip index versions [package] --extra-index-url [https://example.com/simple/]
copy

List versions for a specific platform
$ pip index versions [package] --platform [linux_x86_64]
copy

SYNOPSIS

pip-index [OPTIONS] COMMAND [ARGS]...

Commands:
  versions                   List versions for a package
  wheels                     List wheels for a package/version
  files                       List all files for a package/version

PARAMETERS

--index-url TEXT
    Base URL of Python Package Index (default: https://pypi.org/simple)

--extra-index-url TEXT
    Extra URLs of package indexes to use in addition to --index-url

--json
    Output results as JSON

--cache-dir PATH
    Directory for caching index responses (default: ~/.cache/pip-index)

--no-cache
    Disable caching

--trusted-host HOSTNAME
    Mark hostname as trusted (can be multiple)

--verbose / --quiet
    Increase or decrease verbosity

--cert PATH
    Path to SSL client certificate

--client-cert PATH
    Path to SSL client certificate and key

DESCRIPTION

pip-index is a fast, cache-friendly command-line tool for inspecting Python package repositories like PyPI. It acts as a reliable replacement for pip's experimental index subcommands, offering superior speed through HTTP/2 support, persistent caching, and efficient querying.

Key features include listing package versions with filters for Python versions, platforms, and wheels; retrieving wheel and file lists; and supporting custom indexes. Output can be formatted as JSON for scripting. It handles multiple extra indexes, respects index authentication, and provides verbose logging.

Designed for CI/CD pipelines, dependency checkers, and developers needing quick index metadata without full package downloads. Unlike pip, it avoids unnecessary dependency resolution and focuses solely on index APIs. Caching reduces network calls, making repeated queries instant.

Usage is straightforward: install via pip install pip-index, then query packages directly. Ideal for tools like pip-check-reqs or build scripts.

CAVEATS

Third-party tool, not part of standard pip; requires Python 3.8+. Cache can grow large; use --no-cache for one-offs. Custom indexes must support simple API.

INSTALLATION

Install with pip install pip-index or pipx install pip-index for isolation.

EXAMPLE USAGE

pip-index versions requests
pip-index wheels requests --platform linux_x86_64 --python-version 3.11 --json

HISTORY

Released in 2023 by Markus Holtermann as a performant alternative to pip index (pip 23.0+). Actively maintained with HTTP/2 and caching improvements in v0.2+.

SEE ALSO

pip(1), pipx(1), poetry(1)

Copied to clipboard