|
From: Lasse Kärkkäi. <tr...@us...> - 2011-01-02 02:16:33
|
Module: performous Branch: opengl2 Commit: 16e03f3cdc3cd3b517893a8ea29cd9aa36b1b49d Author: Tapio Vierros <tap...@gm...> Date: Thu Dec 16 23:56:12 2010 +0200 Added a script to fetch ppa download stats from Launchpad. --- tools/ppa/ppastats.py | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-) diff --git a/tools/ppa/ppastats.py b/tools/ppa/ppastats.py new file mode 100755 index 0000000..bef3db5 --- /dev/null +++ b/tools/ppa/ppastats.py @@ -0,0 +1,26 @@ +#!/usr/bin/python +# Prints download stats from Launchpad PPA. + +from launchpadlib.launchpad import Launchpad + +PPAOWNER = "performous-team" # PPA owner +PPA = "ppa" # PPA name + +cachedir = "~/.cache/launchpadlib/" +apiurl = 'https://api.edge.launchpad.net/devel/ubuntu/' + +lp_ = Launchpad.login_anonymously('ppastats', 'edge', cachedir, version='devel') +owner = lp_.people[PPAOWNER] +archive = owner.getPPAByName(name=PPA) + +def printDLCount(distarch): + for i in archive.getPublishedBinaries(status='Published',distro_arch_series=apiurl+distarch): + # Uncomment last part of next line to get daily stats + print i.binary_package_name + "\t" + i.binary_package_version + "\t" + str(i.getDownloadCount()) #+ "\t" + str(i.getDailyDownloadTotals()) + +print "Package\tVersion\tDownloads" #"\tDaily DLs" +print +printDLCount("maverick/i386") +printDLCount("maverick/amd64") +printDLCount("lucid/i386") +printDLCount("lucid/amd64") |