3

Is it possible, using pip or any other command line tool, to get the latest version number of a package on PyPI without downloading it first?

The web page of packages in PyPI will usually provide this information, so I'm assuming there's a chance it's available otherwise.

My goal is to be able to compare the latest version on PyPI and compare it with other sources (like the latest tag in a git repository for example) to detect if it's out-of-date or any other sort of version conflict.

rahmu
  • 5,708
  • 9
  • 39
  • 57
  • 2
    What do you mean "get latest version" without downloading it? How is this different from `pip install package`? – mgilson Jun 12 '13 at 15:29
  • Do you mean you want to know the version number of the latest version of the package? – J0HN Jun 12 '13 at 15:30
  • Yolk can list versions for you: http://stackoverflow.com/questions/4888027/python-and-pip-list-all-versions-of-a-package-thats-available – George Stocker Jun 12 '13 at 15:32
  • 1
    Check out https://github.com/alexmojaki/outdated – Alex Hall Apr 11 '18 at 11:35
  • 2
    @rahmu Say you want the latest version of the `certifi` PyPI package, you can try this : `pythonPackage=certifi;curl -Ls https://pypi.org/pypi/$pythonPackage/json | jq -r .info.version` Of course, you can replace the package `certifi` by the name of the PyPI package you want :) – SebMa Nov 16 '20 at 23:21

0 Answers0