asdf
asdf

Reputation: 3067

Get list of all available pip packages and their versions

I am writing a system where I need to get a list of all available packages that can be installed via the pip running on my machine and their default versions. The reason being I need a way to make a production build of my system reproducible, even if someone manually upgraded a single package for pip.

I currently have this one liner to accomplish it, but it doesn't always work cleanly and I'd prefer to steer away from text parsing if at all possible.

$ pip search * | awk '{print $1 $2}' | cut -d ')' -f 1 | awk -F'(' '{print $1"=="$2}'

Is there an easy way to do this in pip? It would be nice if there was an equivalent to pip freeze but for all the available packages instead of just what's installed.

Upvotes: 4

Views: 4903

Answers (1)

phd
phd

Reputation: 94397

See PyPI Simple API on how to get the list of all available packages without versions.

Upvotes: 3

Related Questions