Helps in carrying out easy workflow for maintaining gists
$ pip install simplegist
Or download it from here and then,
$ cd /to/this/directory/
$ python install setup.py
Go to Github’s Account settings > Applications Create a new token and use it for making API requests instead of password.
# if USERNAME and API_TOKEN are not provided in config.py
GHgist = Simplegist(username='USERNAME',api_token='API_TOKEN')
# else
GHgist = Simplegist()
Below is an example to getting started with using GistAPI and its useful functionalities.
from simplegist import SimpleGist
# provide USERNAME and API_TOKEN in config.py file, so just, GHgist = Gist(), OR,
GHgist = Simplegist(username='USERNAME',api_token='API_TOKEN')
# creating gist and returning url, script, clone link
GHgist.create(name='_GISTNAME', description='_ANY_DESCRIPTION', public=1, content='_CONTENT_GOES_HERE')
# Lists all the names of authenticated user's gists
GHgist.profile().listall()
# Lists only the names of recent two gists of user '_USERNAME'
GHgist.search('_USERNAME').list(2)
# Lists all the comments on gist named '_GISTNAME' of user '_USERNAME'
GHgist.comments().listall(user='_USERNAME',name='_GISTNAME')
# ...and many more...