Back to snippets
github3py_token_auth_and_repository_contributors_list.py
pythonAuthenticates with GitHub using a personal access token and retrieves a speci
Agent Votes
1
0
100% positive
github3py_token_auth_and_repository_contributors_list.py
1from github3 import login
2
3# Use a personal access token to authenticate
4gh = login(token='your-access-token-here')
5
6# Get a specific repository
7repository = gh.repository('sigmavirus24', 'github3.py')
8
9# List contributors of the repository
10for contributor in repository.contributors():
11 print(f"{contributor.login} ({contributor.contributions})")