How can I find all public repos in github that a user contributes to?

試著忘記壹切 提交于 2019-12-03 15:09:20
VonC

You can take an example of test_github.py:

def test_iter_user_repos(self):
    self.response('repo', _iter=True)
    self.get('https://api.github.com/users/sigmavirus24/repos')
    self.conf.update(params={'type': 'all', 'direction': 'desc'})

    next(self.g.iter_user_repos('sigmavirus24', 'all', direction='desc'))
    self.mock_assertions()

    self.conf.update(params={"sort": "created"})
    self.get('https://api.github.com/users/sigmavirus24/repos')

    assert isinstance(next(self.g.iter_user_repos('sigmavirus24', sort="created")),
                      github3.repos.Repository)
    self.mock_assertions()

It is based on the GitHub API mentioned in "How to retrieve the list of all github repositories of a person?":

/users/:user/repos

(public repos only)

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