Created
January 26, 2011 05:08
-
-
Save baijum/796258 to your computer and use it in GitHub Desktop.
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
from py3k.application import db | |
from py3k.model import Distribution | |
import xmlrpclib | |
client = xmlrpclib.ServerProxy('http://pypi.python.org/pypi') | |
# XXX: Remove these hard-coding later | |
package_names = ['zope.interface', 'Twisted'] | |
#package_names = client.list_packages() | |
for name in package_names: | |
release_data = client.release_data(name, client.package_releases(name)[0]) | |
home_page = release_data['home_page'] | |
author = release_data['author'] | |
summary = release_data['summary'] | |
distribution = Distribution() | |
distribution.name = name | |
distribution.home_page = home_page | |
distribution.author = author | |
distribution.summary = summary | |
db.session.add(distribution) | |
db.session.commit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment