Created
December 23, 2011 22:35
-
-
Save atdt/1515565 to your computer and use it in GitHub Desktop.
total pypi downloads by package
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xmlrpclib | |
pypi = xmlrpclib.ServerProxy('http://pypi.python.org/pypi') | |
def get_pypi_downloads(package, all_versions=False): | |
versions = pypi.package_releases(package, all_versions) | |
return sum(downloads | |
for version in versions | |
for filename, downloads | |
in pypi.release_downloads(package, version)) | |
print get_pypi_downloads('Django', all_versions=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment