Comment 38 for bug 139855

Revision history for this message
Jo Shields (directhex) wrote :

I don't have any data for my PPA yet, so I can't be sure this is correct, but it SEEMS to do what it should, minus any numbers yet:

from launchpadlib.launchpad import Launchpad
cachedir = "/home/jms/.launchpadlib/cache/"
launchpad = Launchpad.login_with('badger', 'production')
badgerppa = launchpad.me.getPPAByName(name='ppa')
desired_dist_and_arch = "https://api.launchpad.net/1.0/ubuntu/lucid/amd64"
for individualbadger in badgerppa.getPublishedBinaries(status='Published',distro_arch_series=desired_dist_and_arch):
        print individualbadger.binary_package_name + "\t" + individualbadger.binary_package_version + "\t" + str(individualbadger.getDownloadCount())

Edit to suit your desired PPA name, release, etc. It'll give a count for total downloads of all currently published packages for amd64 lucid (counts are per-release, per-version and per-arch).

Julian, do you have an example of a PPA with valid data which we can poke, pending a full run of the log scanner?