Factsheet
» pip install PyGithub
Videos
Since you mentioned you are a beginner python programmer, I would suggest you to try to use the JSON API without any Github library first. It really isn't that difficult and it will help you a lot later in your programming life since same approach can be applied to any JSON API. Especially if it seems that trying out libraries will take days.
I'm not saying that some library isn't easier to use, I'm just saying the small extra effort to use the API directly might be worth it in the long run. At least it will help you understand why some of those libraries seem "unintuitive" (as you said).
Simple example to fetch creation time of django repository:
import requests
import json
r = requests.get('https://api.github.com/repos/django/django')
if(r.ok):
repoItem = json.loads(r.text or r.content)
print "Django repository created: " + repoItem['created_at']
This is using the popular requests library. In your code you'll naturally need to handle the error cases too.
If you need access with authentication it will be a bit more complex.
In the end, I ended up using PyGithub. It works well, and the author is really receptive for feedback and bug reports. :-)
(Adapted from my edit to the original question, for better visibility)
» pip install github
Actually, if given package is not on PyPI (or you want a specific branch) you can still install it through pip from GitHub with:
pip install git+https://github.com/[repo owner]/[repo]@[branch name]
And for your problem it would be (although @pandita's answer is correct for normal usage case):
pip install git+https://github.com/praw-dev/praw.git
For more information check this answer.
Experimental Python module finder/loader from github, like in golang.
So, in golang we can import like:
import "github.com/parnurzeal/gorequest"
But in python we should install package by our hands:
pip install requests
And import it like:
import requests
But with this magic package and power of PEP-0302 we can do it automatically:
from github_com.kennethreitz import requests
assert requests.get('https://github.com/nvbn/import_from_github_com').status_code == 200
Installation
You should have git, Python 3.2+ and pip:
pip install import_from_github_com
Reference: https://github.com/nvbn/import_from_github_com