Skip to content

Instantly share code, notes, and snippets.

@jezcope
Last active August 29, 2015 14:19
Show Gist options
  • Save jezcope/a271e905dac9cf9eec18 to your computer and use it in GitHub Desktop.
Save jezcope/a271e905dac9cf9eec18 to your computer and use it in GitHub Desktop.
Format a user's list of github repositories as Markdown links
import requests
from pprint import pprint as pp

USER='jezcope'
API_TOKEN='Get your own API token!'
GIT_API_URL='https://api.github.com'

r = requests.get(GIT_API_URL + "/users/datacarpentry/repos?per_page=100", auth=(USER, API_TOKEN))

if r.status_code == 200:
    repos = r.json()
    for repo in repos:
        print("- [%s](%s)" % (repo['name'], repo['html_url']))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment