Created
June 10, 2020 12:42
-
-
Save pokgak/c071bba10436496bc85a5da3f8633b2a to your computer and use it in GitHub Desktop.
Get all timer issues/PR for RIOT-OS
This file contains 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
#!/bin/env python3 | |
import requests | |
import csv | |
issues = [] | |
print(f"count: {len(issues)}") | |
params = { | |
"labels": "Area: timers", | |
"state": "all", | |
} | |
req = requests.get("https://api.github.com/repos/RIOT-OS/RIOT/issues", params=params) | |
if req.status_code != 200: | |
raise ValueError(f"Status code: {req.status_code}") | |
issues += req.json() | |
print(f"count: {len(issues)}") | |
while 'next' in req.links: | |
req = requests.get(req.links['next']['url']) | |
if req.status_code != 200: | |
raise ValueError(f"Status code: {req.status_code}") | |
issues += req.json() | |
print(f"count: {len(issues)}") | |
print("DONE") | |
with open("issues.csv", "w") as f: | |
fieldnames = [ | |
# "id", | |
"number", | |
"title", | |
"state", | |
"html_url", | |
# "is_pull_request", | |
"pull_request", | |
"created_at", | |
"updated_at", | |
"closed_at", | |
# "url", | |
# "repository_url", | |
# "labels_url", | |
# "comments_url", | |
# "events_url", | |
# "node_id", | |
# "user", | |
# "labels", | |
# "locked", | |
# "assignee", | |
# "assignees", | |
# "milestone", | |
# "comments", | |
# "author_association", | |
# "body", | |
] | |
writer = csv.DictWriter(f, fieldnames=fieldnames, extrasaction="ignore") | |
writer.writeheader() | |
writer.writerows(issues) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment