diff --git a/RepoFunctions.py b/RepoFunctions.py index a6c1529..ebe8392 100644 --- a/RepoFunctions.py +++ b/RepoFunctions.py @@ -2,6 +2,7 @@ import os import requests import json import subprocess +import pandas as pd def get_Releases(org, repo_name, latest=False): @@ -29,3 +30,20 @@ def refresh_repo(repo_name): ["git", "pull"], cwd=base_path ) + +def get_pull_requests(org, repo_name): + api_url = "https://api.github.com/repos/{}/{}/pulls?state=all".format(org, repo_name) + + header = { + "Accept":"application/vnd.github.v3+json" + } + + res = requests.get(api_url) + json_res = json.loads(res.text) + + #Taking Top 5 PR + top5 = json_res[0:5] + + top5_infos = pd.DataFrame([ [ele['created_at'], ele['title'], ele['state'], ele['user']['login'], ele['url']] for ele in top5], columns = ['Created', 'Title', 'Status', 'User', 'Url']) + +