Skip to content

Instantly share code, notes, and snippets.

@jnothman
Created September 29, 2016 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jnothman/8eba0834acfd633c6d83b437f6f18c49 to your computer and use it in GitHub Desktop.
Save jnothman/8eba0834acfd633c6d83b437f6f18c49 to your computer and use it in GitHub Desktop.
github issues to spreadsheet
#!/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))' $@
#!/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
#!/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