Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 259
asdf Avatar asked Sep 10 '25 10:09

asdf


1 Answers

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

like image 164
phd Avatar answered Sep 13 '25 00:09

phd