Created
May 19, 2013 23:42
Export issues from Github as JSON
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
""" | |
Exports Issues from a specified repository. | |
Uses basic authentication (Github username + password) to retrieve Issues | |
from a repository that username has access to. Supports Github API v3. | |
From: | |
https://gist.github.com/unbracketed/3380407 | |
""" | |
import requests | |
GITHUB_USER = '' | |
GITHUB_PASSWORD = '' | |
REPO = '' # format is username/repo | |
ISSUES_FOR_REPO_URL = 'https://api.github.com/repos/%s/issues' % REPO | |
AUTH = (GITHUB_USER, GITHUB_PASSWORD) | |
r = requests.get(ISSUES_FOR_REPO_URL, auth=AUTH) | |
if not r.status_code == 200: | |
raise Exception(r.status_code) | |
with open('issues.json', 'w') as outfile: | |
json.dump(r.json(), outfile) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment