Last active
September 26, 2022 02:26
-
-
Save masaki925/3c16d1a6bdffa0f8c5248029e8a31059 to your computer and use it in GitHub Desktop.
GitHub issues to tsv
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
OWNER=masaki925 | |
REPO=repo | |
# ref: https://github.com/settings/tokens | |
TOKEN=<TOKEN> | |
# ref: https://docs.github.com/en/rest/issues/issues#list-repository-issues | |
# | |
curl \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${TOKEN}" \ | |
"https://api.github.com/repos/${OWNER}/${REPO}/issues?per_page=100&labels=Data+Product&state=open" | \ | |
jq ".[] | {title: .title, url: .html_url}" |
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
import json | |
from pandas import json_normalize | |
with open('issues.json') as f: | |
json_str = f.read() | |
data = json.loads(json_str) | |
df = json_normalize(data) | |
df.to_csv('issues.tsv', sep="\t") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment