[Distutils] PyPI search RPC not working as expected

Vinay Sajip vinay_sajip at yahoo.co.uk
Fri Aug 28 22:06:40 CEST 2015


The PyPI XML-RPC API seems not to be working as expected. The following
simple script:

from pprint import pprint
import sys
try:
    from xmlrpclib import ServerProxy
except ImportError:
    from xmlrpc.client import ServerProxy

rpc_proxy = ServerProxy('https://pypi.python.org/pypi')
if len(sys.argv) < 2:
    pkg = 'sarge'
else:
    pkg = sys.argv[1]
pprint(rpc_proxy.search({'name': pkg}))

Returns an empty list when passed the command line argument "tatterdema" (it
should match my project "tatterdemalion"), whereas it does return a
non-empty list when passed "sarg" (matching my project "sarge"), or when
passed "jobswo" (matching my project "jobsworth"). My project "ragamuffin"
also fails to show up if passed to the script.

Can anyone shed any light on this? Have there been any changes to how the
search is supposed to work?

Regards,

Vinay Sajip



More information about the Distutils-SIG mailing list