Skip to content

Instantly share code, notes, and snippets.

@masaki925
Last active September 26, 2022 02:26
Show Gist options
  • Save masaki925/3c16d1a6bdffa0f8c5248029e8a31059 to your computer and use it in GitHub Desktop.
Save masaki925/3c16d1a6bdffa0f8c5248029e8a31059 to your computer and use it in GitHub Desktop.
GitHub issues to tsv
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}"
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