Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    github3.py 0.5.3

    Download button

    No screenshots available
    Downloads: 166  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    sigmavirus24 | More programs
    BSD License / FREE
    September 10th, 2012, 07:45 GMT [view history]
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    github3.py description

    Python wrapper for the GitHub API

    github3.py is a Python module to access the GitHub v3 API.

    Easy Cloning

    Assuming 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 update


    Examples

    >>> from github3 import login
    >>> gh = login(username, password)
    >>> gists = gh.list_gists()
    >>> files = {'spam.txt' : {'content': 'What... is the air-speed velocity of an
    unladen swallow?'}}
    >>> gh.create_gist('Answer this to cross the bridge', files, public=False)
    < Gist [gist-id] >

    >>> from github3 import create_gist
    >>> files = {'spam.txt' : {'content': 'What... is the air-speed velocity of an
    unladen 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_url
    u'https://github.com/sigmavirus24/issues.py/issues/2'
    >>> issue.state
    u'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_url
    u'https://github.com/sigmavirus24/Todo.txt-python/issues/17'
    >>> issue.state
    u'open'
    >>> events = issue.list_events()
    >>> events
    [< Issue Event [#17 - subscribed - sigmavirus24] >, < Issue Event [#17 - assigned - sigmavirus24] >,
     < Issue Event [#17 - referenced - sigmavirus24] >]
    >>> events[0].actor
    < User [sigmavirus24:None] >
    >>> events[0].issue
    < Issue [sigmavirus24/Todo.txt-python #17] >
    >>> events[0].closed_at
    >>> events[0].event
    u'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')
    >>> sha
    u'57fad9a39b27e5eb4700f66673ce860b65b93ab8'
    >>> blob = repo.blob(sha)
    >>> blob.content
    u'VGVzdGluZyBibG9iIGNyZWF0aW9u\n'
    >>> blob.decoded
    u'Testing blob creation'
    >>> blob.encoding
    u'base64'



    Product's homepage

    Requirements:

    · Python
    · requests

    What's New in This Release: [ read full changelog ]

    · Add missing optional parameter to Repository.contents. Thanks @tpetr

      


    TAGS:

    GitHub API | Python library | Python | GitHub | API

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM