Skip to content

Instantly share code, notes, and snippets.

@skettler
Forked from rgl/ppa_stats.py
Created October 2, 2011 20:32
Show Gist options
  • Save skettler/1257892 to your computer and use it in GitHub Desktop.
Save skettler/1257892 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'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment