Python 如何在Github中获取项目的总贡献者
我尝试使用以下python代码使用api“”获取项目的参与者 代码是:Python 如何在Github中获取项目的总贡献者,python,github,github-api,Python,Github,Github Api,我尝试使用以下python代码使用api“”获取项目的参与者 代码是: import json, requests all_contributors = list() page_count = 1 while True: contributors = requests.get("https://api.github.com/repos/rubinius/rubinius/contributors?page=%d"%page_count) if contributors != No
import json, requests
all_contributors = list()
page_count = 1
while True:
contributors = requests.get("https://api.github.com/repos/rubinius/rubinius/contributors?page=%d"%page_count)
if contributors != None and contributors.status_code == 200 and len(contributors.json()) > 0:
all_contributors = all_contributors + contributors.json()
else:
break
page_count = page_count + 1
count=len(all_contributors)
print("-------------------%d" %count)
总投稿人是349,在网站上,总投稿人是408,我可以知道我的程序哪里有问题吗
谢谢有些贡献者是匿名的。所以考虑设置?ANON = 1参数
请参阅。但是如果我使用?anon=1,总数是576,这就是原因