Extract the package list from pypi simple api efficiently.

Hongyi Zhao hongyi.zhao at gmail.com
Fri Oct 30 09:22:25 EDT 2020


Hi,

The pypi exposes its simple api at <https://pypi.org/simple/>, which can be used to extract the complete package name list. I want to do the job efficiently and write the following simple codes:


import requests
proxies = {
	'http': 'socks5h://127.0.0.1:18888',
	'https': 'socks5h://127.0.0.1:18888'
}


requests.packages.urllib3.disable_warnings()
r = requests.get('https://pypi.org/simple/', proxies=proxies, verify=False)


The package name info is included in the r.text string object, but I still can't figure out how to further extract them efficiently.


Any hints will be highly appreciated.

Regards,
HY


More information about the Python-list mailing list