-
Notifications
You must be signed in to change notification settings - Fork 349
Closed
Description
"pip inspect" retunrs json presentation od the distribution
json past work
#850
def get_official_description(name):
"""Extract package Summary description from pypi.org"""
from winpython import utils
this = normalize(name)
this_len = len(this)
pip_ask = ['pip', 'search', this, '--retries', '0']
if len(this)<2: # don't ask stupid things
return ''
try:
# .run work when .popen fails when no internet
pip_res = (utils.exec_run_cmd(pip_ask)+'\n').splitlines()
pip_filter = [l for l in pip_res if this + " (" ==
normalize(l[:this_len])+l[this_len:this_len+2]]
pip_desc = (pip_filter[0][len(this)+1:]).split(" - ", 1)[1]
return pip_desc.replace("://", " ")
except:
return ''
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels