def issues_closed_since( period=timedelta(days=365), project="statsmodels/statsmodels", pulls=False): """Get all issues closed since a particular point in time. period can either be a datetime object, or a timedelta object. In the latter case, it is used as a time before the present. """ which = 'pulls' if pulls else 'issues' if isinstance(period, timedelta): since = round_hour(datetime.utcnow() - period) else: since = period url = "https://api.github.com/repos/%s/%s?state=closed&sort=updated&since=%s&per_page=%i" % ( project, which, since.strftime(ISO8601), PER_PAGE) allclosed = get_paged_request(url, headers=make_auth_header()) filtered = [ i for i in allclosed if _parse_datetime(i['closed_at']) > since ] if pulls: filtered = [ i for i in filtered if _parse_datetime(i['merged_at']) > since ] # filter out PRs not against master (backports) filtered = [i for i in filtered if i['base']['ref'] == 'master'] else: filtered = [i for i in filtered if not is_pull_request(i)] return filtered
def issues_closed_since(period=timedelta(days=365), project="ipython/ipython", pulls=False): """Get all issues closed since a particular point in time. period can either be a datetime object, or a timedelta object. In the latter case, it is used as a time before the present. """ which = "pulls" if pulls else "issues" if isinstance(period, timedelta): since = round_hour(datetime.utcnow() - period) else: since = period url = "https://api.github.com/repos/%s/%s?state=closed&sort=updated&since=%s&per_page=%i" % ( project, which, since.strftime(ISO8601), PER_PAGE, ) allclosed = get_paged_request(url, headers=make_auth_header()) filtered = [i for i in allclosed if _parse_datetime(i["closed_at"]) > since] if pulls: filtered = [i for i in filtered if _parse_datetime(i["merged_at"]) > since] # filter out PRs not against master (backports) filtered = [i for i in filtered if i["base"]["ref"] == "master"] else: filtered = [i for i in filtered if not is_pull_request(i)] return filtered
def get_issues(project="statsmodels/statsmodels", state="closed", pulls=False): """Get a list of the issues from the Github API.""" which = 'pulls' if pulls else 'issues' url = "https://api.github.com/repos/%s/%s?state=%s&per_page=%i" % ( project, which, state, PER_PAGE) return get_paged_request(url, headers=make_auth_header())
def get_issues(project="ipython/ipython", state="closed", pulls=False): """Get a list of the issues from the Github API.""" which = 'pulls' if pulls else 'issues' url = "https://api.github.com/repos/%s/%s?state=%s&per_page=%i" % ( project, which, state, PER_PAGE) return get_paged_request(url, headers=make_auth_header())