Created
September 29, 2016 14:29
-
-
Save jnothman/8eba0834acfd633c6d83b437f6f18c49 to your computer and use it in GitHub Desktop.
github issues to spreadsheet
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/bash | |
jq -s 'add | map({user: .user.login, | |
milestone: .milestone.title, | |
labels: .labels | map(.name) | join("|"), | |
created_at, | |
closed_at, | |
updated_at, | |
state, | |
comments, | |
title, | |
refers: (select(.body) | .body + " " + .title | [match("(?:(?<=\\s)|^)#[0-9]+(?=\\s|$)"; "g") | .string] | unique | join("|")), | |
number, | |
pull_request: (.pull_request != null) | |
} + (.labels | map({("_label:" + .name): true}) | add))' $@ |
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/bash | |
# FIXME: terminating condition may not be succeeding atm | |
page=1 | |
while [ -n "$page" ] | |
do | |
while [ ! -s issues.$page.json ] | |
do | |
curl -D heads "$@" "https://api.github.com/repos/scikit-learn/scikit-learn/issues?state=all&per_page=100&page=$page" > issues.$page.json | |
sleep 10 | |
done | |
page=$(grep '^Link:' heads | grep -oE '[0-9]+>; rel="next"' | grep -oE '[0-9]+') | |
done |
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
#!/usr/bin/env python | |
import sys | |
import pandas as pd | |
pd.read_json(sys.stdin).set_index('number').to_csv(sys.stdout) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment