Number of Packages in the "cheeseshop"

Michael Rudolf spamfresser at ch3ka.de
Thu Mar 5 05:40:33 EST 2009


Hi, I just wondered how many Packages are in the Python Package Index.

I could not find any counter, but I found that there is a category
overview on http://pypi.python.org/pypi?%3Aaction=browse .

A quick look at the HTML told me that the number of Packages per
Category is listed surrounded by parentheses, at most one per line.

So I counted them:

import urllib
sum=0
for t in urllib.urlopen('http://pypi.python.org/pypi?%3Aaction=browse'):
    t=t.split('(')[-1].split(')')[0]
    try:
        sum += int(t)
    except ValueError:
        pass # print "OMG cannot convert %s to int" % t
print "sum is: %s" % sum 

Which yields: sum is: 31670

That would be around half the weight of CPAN, which would be a
not-so-bad result ;)

My Questions: 
a) Are there package listed in multiple Categories, which would breaking
my counting?
b) Did I make some other mistake(s)?
c) is there a counter which yields the current number of PyPI-Packages?

PS: Please excuse my bad english, I am not a native speaker.	

THX, Michael



More information about the Python-list mailing list