Created
June 23, 2018 07:44
-
-
Save kobakou/e54fc08464cdb874697bcc292187c262 to your computer and use it in GitHub Desktop.
get-issues-from-github-repo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from github import Github | |
import pandas as pd | |
# or using an access token | |
g = Github("") | |
for _repo in g.get_organization('your-org').get_repos(type='private'): | |
if _repo.name == 'your-repo': | |
repo = _repo | |
break | |
issueslist = [] | |
for _issue in repo.get_issues(state=('open')): | |
#print('{:<4}\t{}\t{}\t{}\t{}'.format(_issue.number, _issue.title, _issue.labels, _issue.created_at, _issue.closed_at)) | |
issueslist.append([_issue.number, _issue.title, _issue.labels, _issue.created_at, _issue.closed_at]) | |
for _issue in repo.get_issues(state=('closed')): | |
#print('{:<4}\t{}\t{}\t{}\t{}'.format(_issue.number, _issue.title, _issue.labels, _issue.created_at, _issue.closed_at)) | |
issueslist.append([_issue.number, _issue.title, _issue.labels, _issue.created_at, _issue.closed_at]) | |
issuedf = pd.DataFrame(issueslist, columns=['id','title','labels','create_at','closed_at']) | |
issuedf.to_csv('issues.tsv', sep='\t', index=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment