Skip to content

Instantly share code, notes, and snippets.

@rokcarl
Created December 31, 2014 09:32
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 rokcarl/0844ffb917facb8b5822 to your computer and use it in GitHub Desktop.
Save rokcarl/0844ffb917facb8b5822 to your computer and use it in GitHub Desktop.
github_read_file_from_private_repo.py
import requests
auth = ('username', 'password')
filepath = '/views/index.py'
result = requests.get('https://api.github.com/repos/:company/:repo/contents{}'.format(filepath), auth=auth).json()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment