I'm researching on a project, which involves python to use GitHub API to collect the no of stars, contributors, PR's and issues from a repo (https://github.com/ and store it in a CSV file.
I'm trying to use BeautifulSoup4, but API method is a more stable way to go. Below is my small snippet. Im not sure how to get the info of no of issues raised by certain contributors of a company v/s non-company(to check the external contributors) using github API(pygithub).
from github import Github
# using username and password
# or using an access token
g = Github("***************************")
for repo in g.get_user().get_repos():
print(repo.name)
print("**********Get Current Repos**********")
user = g.get_user()
user.login
print(user.login)
repo = g.get_repo("<any-repo>/<any-repo>")
repo.name
print(repo.name)
print("********Get the Repo Topics**************")
repo = g.get_repo("<any-repo>/<any-repo>")
repo.get_topics()
print(repo.get_topics())
print("*****Get the Star Count*************")
repo = g.get_repo("<any-repo>/<any-repo>")
repo.stargazers_count
print(repo.stargazers_count)
print("********Get the Open Issues*********")
repo = g.get_repo("<any-repo>/<any-repo>")
open_issues = repo.get_issues(state='open')
for issue in open_issues:
print(issue)
print("******Get the Branch Count*******")
repo = g.get_repo("<any-repo>/<any-repo>")
print(list(repo.get_branches()))
PS: Im still a python noobie.