gpt4 book ai didi

json - GitHub 上大多数 "popular"Python 存储库

转载 作者:行者123 更新时间:2023-12-01 17:31:27 24 4
gpt4 key购买 nike

基于v3 documentation我本以为是这样的:

$ curl https://api.github.com/legacy/repos/search/python?language=Python&sort=forks&order=desc

将按分支数量降序返回前 100 个 Python 存储库。它实际上返回一个空的(json)存储库列表。

这个:

$ curl https://api.github.com/legacy/repos/search/python?language=Python&sort=forks

返回存储库列表(以 json 格式),但其中许多未列为 Python 存储库。

所以,显然我误解了 Github API。检索特定语言的前 N 个存储库的公认方法是什么?

最佳答案

正如 pengwynn 所说,目前仅通过 GitHub 的 API 很难做到这一点。但是,请查看使用 GitHub Archive 项目进行查询的替代方法: How to find the 100 largest GitHub repositories for a past date?

本质上,您可以使用类似 SQL 的语言来查询 GitHub 的历史数据。因此,如果实时结果对您来说并不重要,您可以在 https://bigquery.cloud.google.com/?pli=1 上执行以下查询获取截至 2013 年 4 月 1 日(昨天)的前 100 个 Python 存储库,按 fork 数量递减:

SELECT MAX(repository_forks) as forks, repository_url 
FROM [githubarchive:github.timeline]
WHERE (created_at CONTAINS "2013-04-01" and repository_language = "Python")
GROUP BY repository_url
ORDER BY forks
DESC LIMIT 100

我已将查询结果放入 this Gist 中CSV 格式,前几个存储库是:

forks  repository_url
1913 https://github.com/django/django
1100 https://github.com/facebook/tornado
994 https://github.com/mitsuhiko/flask
...

关于json - GitHub 上大多数 "popular"Python 存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15749738/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com