pypi see older versions of package

PythonDjangoPypi

Python Problem Overview


This is the package I'm interested in:

Django filebrowser no Grappelli

However, the latest version no longer supports Django 1.3. I need to find a version that does. How do I see a list of older versions?

Python Solutions


Solution 1 - Python

It's perhaps a little inelegant, but it appears that you can go to the URL

https://pypi.python.org/simple/<package>

And you will get a bunch of links to tarballs for the package.

Ex:

https://pypi.python.org/simple/django-filebrowser-no-grappelli/

Solution 2 - Python

This is visible in the new UI for pypi:

https://pypi.org/project/<package>/#history

For example:

https://pypi.org/project/django-filebrowser-no-grappelli/#history

Solution 3 - Python

You can use this short Python 3 script to grab the list of available versions for a package from PyPI using JSON API:

#!/usr/bin/env python3

import sys    
import requests
from pkg_resources import parse_version    

def versions(pkg_name):
    url = f'https://pypi.python.org/pypi/{pkg_name}/json'
    releases = requests.get(url).json()['releases']
    return sorted(releases, key=parse_version, reverse=True)    

if __name__ == '__main__':
    print(*versions(sys.argv[1]), sep='\n')

Demo:

$ python versions.py django-filebrowser-no-grappelli
3.7.8
3.7.7
3.7.6
3.7.5
3.7.4
3.7.3
3.7.2
3.7.1
3.7.0
3.6.2
3.6.1
3.5.8
3.5.7
3.5.6
3.1.1

Solution 4 - Python

Using pip you can find out all the available versions of that package:

pip install django-filebrowser-no-grappelli==randomwords

This will produce an output of all the available packages:

Could not find a version that satisfies the requirement
  django-filebrowser-no-grappelli==randomwords
(from versions: 3.1.1, 3.5.6, 3.5.7, 3.5.8, 3.6.1, 3.6.2, 3.7.0, 3.7.1, 3.7.2)
   No matching distribution found for
   django-filebrowser-no-grappelli==randomwords

Solution 5 - Python

Store the following code in the get_version.py file:

import json
import sys
import urllib2

from distutils.version import LooseVersion

name = sys.argv[1]

resp = urllib2.urlopen("https://pypi.python.org/pypi/{}/json".format(name))
data = json.load(resp)

for ver in sorted([LooseVersion(version) for version in data["releases"].keys()]):
    print ver.vstring

Run it to get a sorted list of all package versions:

python get_version.py %PACKAGE-NAME%

Solution 6 - Python

If you are using pip to install your package, then you may use:

pip install yolk
yolk -V django-filebrowser-no-grappelli

Unfortunately the only available version seems to be:

django-filebrowser-no-grappelli 3.1.1

However, you can try to find another version on the Internet and install by:

pip install -Iv <url_package>

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMarijusView Question on Stackoverflow
Solution 1 - Pythonlimp_chimpView Answer on Stackoverflow
Solution 2 - PythonngoldbaumView Answer on Stackoverflow
Solution 3 - PythonEugene YarmashView Answer on Stackoverflow
Solution 4 - PythonTwengg RichView Answer on Stackoverflow
Solution 5 - PythonArchibaldView Answer on Stackoverflow
Solution 6 - Pythonf_ficarolaView Answer on Stackoverflow