Since I operate a few Personal Package Archives over on Launchpad I wanted a way to log the number of downloads for each package and file them by date. Fortunately there’s Launchpad’s API and Python.
Scripting FTW
Below is a generic version of the Python script I use to log the download count (of a particular system architecture) of each package for one PPA. And because of my need for organization it does it all by date.
If you were to use it yourself you need only make a few alterations:
enter the PPA details, mainly the owner’s username and the PPA name, that you would like and pick a system architecture –the values for PPAOWNER, PPANAME & ARCH.
comment out/remove any code that would be incompatibile; for example, if the PPA in question doesn’t have Precise (12.04) or i386 support than than you wouldn’t look up the data for either as Launchpad would throw back an error.
That’s it (and you may feel the need to run it daily as a cron job). Here’s hoping it’s useful to some of you! :)
Download it as a text file