Skip to content

Instantly share code, notes, and snippets.

@rgl
Created April 27, 2011 07:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rgl/943881 to your computer and use it in GitHub Desktop.
Save rgl/943881 to your computer and use it in GitHub Desktop.
outputs the download count of a PPA
# this outputs the download count of a PPA
#
# See https://api.launchpad.net/+apidoc/devel.html#binary_package_publishing_history
# See https://help.launchpad.net/API/launchpadlib
from launchpadlib.launchpad import Launchpad
cachedir = '/home/rgl/.launchpadlib/cache/'
launchpad = Launchpad.login_anonymously('just testing', 'production', cachedir)
ppa = launchpad.people['rgl'].getPPAByName(name='elasticsearch')
binaries = ppa.getPublishedBinaries(binary_name='elasticsearch', version='0.16.0-0ubuntu1')
b1 = binaries[0]
print(b1.getDownloadCount())
print(b1.getDailyDownloadTotals(start_date='2011-04-20', end_date='2011-04-21'))
@stefansundin
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment