Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何在Github中获取项目的总贡献者_Python_Github_Github Api - Fatal编程技术网

Python 如何在Github中获取项目的总贡献者

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

我尝试使用以下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 != 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,这就是原因