One of those things that comes up from time to time is that you want to be able to find out some information about a package on PyPi. It turns out that PyPi offers a web API with super easy to parse JSON output.

Take for example the Persephone automated speech transcription project that I was contributing to:

If we go to that URL we can see all the metadata about what was uploaded to PyPi, very useful. We could for example check to see what the most recent version on PyPi is:

>>> import requests
>>> r = requests.get('', timeout=1)
>>> most_recent_pypi_version = r.json()['info']['version']
>>> print(most_recent_pypi_version)

As you can see this is a fairly useful way to do things that require information about recent versions. For example you can use this to make CLI scripts that will inform the user if there's an update available.