get last update of a pip package programatically

☆樱花仙子☆ 提交于 2020-05-31 04:26:06

问题


( Apologies for an issue with the initial title of this question due to a copy paste issue)

On pypi.org I can search for packages by relevance or by "Date last updated"

What I'd really like to search for is by relevance and "Date last update" less than (for example) a year ago.

As the web frontend doesn't provide this I thought about writing a small script doing this for me.

Basic idea: - call pip search "name" - parse the output and get via an api the last changed date and filter if too old - try to find a way to determine the relevance (perhaps just with https://pypi.org/search/?q=searchword )

cross both results.

So does anybody know how to get the last change date on pypi.org for a given python package (or list of packages)?


回答1:


You're looking for JSON API. Projects don't have last modification date but releases have upload timestamp. So it's

json["releases"][version][package_index]["upload_time"]


来源:https://stackoverflow.com/questions/61786395/get-last-update-of-a-pip-package-programatically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!