Created
May 10, 2019 22:06
-
-
Save gjyoung1974/49d2b1a8f4039bba544205372d7dcc3d to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python | |
# This script gets a population of closed pull requests | |
from github import Github | |
import pandas as pd | |
from datetime import datetime | |
git_hub = Github("") | |
repo = git_hub.get_repo("") | |
pulls = repo.get_pulls(state='closed', sort='created', direction='desc') | |
pull_requests = [] | |
for pr in pulls: | |
if pr.merged_at is not None: | |
if pr.merged_at >= datetime(2018, 03, 01, 00, 00): | |
print(pr.title) | |
pull_requests.append({ | |
'number': pr.number, | |
'user': pr.user, | |
'url': pr.url, | |
'title': pr.title, | |
'labels': pr.labels, | |
'state': pr.state, | |
'comment_count': pr.comments, | |
'created_at': pr.created_at, | |
'merged_at': pr.merged_at, | |
'merged_by': pr.merged_by | |
}) | |
github_query = pd.DataFrame(pull_requests) | |
# github_query.DataFrame(columns=['number', 'user', 'url', 'title', 'labels', 'state', | |
# 'comment_count', 'created_at', 'merged_at', 'merged_by']) | |
github_query.to_excel(".xlsx") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment