github3.py

Python wrapper for the GitHub API
Download

github3.py Ranking & Summary

Advertisement

  • Rating:
  • License:
  • BSD License
  • Price:
  • FREE
  • Publisher Name:
  • sigmavirus24
  • Publisher web site:
  • https://github.com/sigmavirus24

github3.py Tags


github3.py Description

github3.py is a Python module to access the GitHub v3 API.Easy CloningAssuming you have git 1.7.x (although I'm not entirely certain what version it was introduced in) you can perform git clone --recursive git://github.com/sigmavirus24/github3.py.git github3.py to clone this and the submodule at the same time. Otherwise you have to do: git clone git://github.com/sigmavirus24/github3.py.git cd github3.py git submodule init git submodule updateExamples>>> from github3 import login>>> gh = login(username, password)>>> gists = gh.list_gists()>>> files = {'spam.txt' : {'content': 'What... is the air-speed velocity of anunladen swallow?'}}>>> gh.create_gist('Answer this to cross the bridge', files, public=False)< Gist >>>> from github3 import create_gist>>> files = {'spam.txt' : {'content': 'What... is the air-speed velocity of anunladen swallow?'}}>>> gist = create_gist('Answer this to cross the bridge', files, public=False)>>> gist.list_comments()[]>>> gist.create_comment('Bogus. This will not work.')# Which of course it didn't, because you're not logged in>>> from github3 import login>>> gh = login(username, password)>>> issue = gh.issue('sigmavirus24', 'issues.py', 2)>>> issue.html_urlu'https://github.com/sigmavirus24/issues.py/issues/2'>>> issue.stateu'open'>>> issue.close()True>>> issue.reopen()True>>> issue.edit('Testing Github3.py', 'Testing re-opening', 'sigmavirus24')True>>> from github3 import login>>> gh = login(username, password)>>> issue = gh.issue('sigmavirus24', 'Todo.txt-python', 17)>>> issue.html_urlu'https://github.com/sigmavirus24/Todo.txt-python/issues/17'>>> issue.stateu'open'>>> events = issue.list_events()>>> events >, < Issue Event >, < Issue Event >]>>> events.actor< User >>>> events.issue< Issue >>>> events.closed_at>>> events.eventu'subscribed'>>> from github3 import login>>> g = login(username, password)>>> repo = g.repository('sigmavirus24', 'Todo.txt-python')>>> sha = repo.create_blob('Testing blob creation', 'utf-8')>>> shau'57fad9a39b27e5eb4700f66673ce860b65b93ab8'>>> blob = repo.blob(sha)>>> blob.contentu'VGVzdGluZyBibG9iIGNyZWF0aW9u\n'>>> blob.decodedu'Testing blob creation'>>> blob.encodingu'base64'Product's homepage


github3.py Related Software