Skip to content

Instantly share code, notes, and snippets.

@allanca
Created May 5, 2016 17:29
Show Gist options
  • Save allanca/f60124dc6de234b415ff7d60bea3c3b3 to your computer and use it in GitHub Desktop.
Save allanca/f60124dc6de234b415ff7d60bea3c3b3 to your computer and use it in GitHub Desktop.
List the collaborators to a repo in github
#!/usr/bin/env python
from pygithub3 import Github
gh = Github(login='', password='')
def get_collabs(repo):
collaborators = gh.repos.list_contributors(user=repo.split('/')[0], repo=repo.split('/')[1])
for collaborator in collaborators.iterator():
user = gh.users.get(collaborator.login)
if not user.location or ('SF' not in user.location and 'Francisco' not in user.location and 'Oakland' not in user.location):
continue
print(''.join([(user.location or '-').ljust(50), user.url.ljust(50), "https://github.com/%s/commits/master?author=%s" % (repo, collaborator.login)]))
# commits = gh.repos.commits.list(user=repo.split('/')[0], repo=repo.split('/')[1], author=collaborator.login)
# print(commits.all()[0].html_url)
get_collabs('reactjs/redux')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment