Search code examples
pythonpypi

how to see less recent packages on pypi


I saw some really interesting packages on pypi yesterday. They've fallen off the list today and (being senile) I don't recall enough detail to get to them. How do I get a list of all packages for (say) the last week?


Solution

  • PyPi has an xmlrpc API. You can get a list of recent releases with an updated_releases method. It returns a list of releases made since given timestamp.

    For example, it may look like this:

    import xmlrpclib
    import time
    
    client = xmlrpclib.ServerProxy("https://pypi.python.org/pypi")
    
    interval = 86400*2
    for package, version in client.updated_releases(int(time.time()) - interval):
        print "%s %s" % (package, version)
    

    Additionally there is a release_data(package_name, release_version) method to get more details about particular release