[Catalog-sig] pypi xmlrpc

Ian Bicking ianb at colorstudy.com
Tue Jun 7 20:09:12 CEST 2005


Ed Summers wrote:
> I heard a rumor (on here i think) that there was some xmlrpc support 
> added to pypi at pycon2005. Is there any documentation on the functions 
> you can call and the urls? Is the code available for perusal in svn or 
> cvs?

They added what we gave them, which wasn't much ;)  Here's the functions 
currently available:

def echo(store,*args):
     return args

def index(store,*args):
     spec = { }
     return store.query_packages( spec )

def search(store,*args):
     term = args[0]
     spec = { 'name' : term, 'summary' : term }
     return store.query_packages( spec, andor='or' )


Usage:

 >>> import xmlrpclib
 >>> pypi = xmlrpclib.ServerProxy('http://python.org/pypi')
 >>> pypi.search('pypi')
({'info': ['pypi', '2004-03-01', 'PyPI is the Python Package Index at 
http://www.python.org/pypi'], 'cols': ['name', 'version', 'summary'], 
'cols_d': {'version': 1, 'name': 0, 'summary': 2}}, {'info': ['pypi', 
'2004-03-02', 'PyPI is the Python Package Index at 
http://www.python.org/pypi'], 'cols': ['name', 'version', 'summary'], 
'cols_d': {'version': 1, 'name': 0, 'summary': 2}}, {'info': ['pypi', 
'2004-06-21', 'PyPI is the Python Package Index at 
http://www.python.org/pypi'], 'cols': ['name', 'version', 'summary'], 
'cols_d': {'version': 1, 'name': 0, 'summary': 2}}, {'info': ['pypi', 
'2004-06-23', 'PyPI is the Python Package Index at 
http://www.python.org/pypi'], 'cols': ['name', 'version', 'summary'], 
'cols_d': {'version': 1, 'name': 0, 'summary': 2}}, {'info': ['pypi', 
'2004-07-14', 'PyPI is the Python Package Index at 
http://www.python.org/pypi'], 'cols': ['name', 'version', 'summary'], 
'cols_d': {'version': 1, 'name': 0, 'summary': 2}})


I proposed some new functions in an email a week or two ago.

-- 
Ian Bicking  /  ianb at colorstudy.com  /  http://blog.ianbicking.org


More information about the Catalog-sig mailing list