Skip to main content

Python wrapper for the GitHub API (http://developer.github.com/v3)

Project description

Build Status

Eventually this will be a python module to access the GitHub v3 API.

This is not stable yet and there is no backwards compatibility yet. There will likely be some changes which change behavior in the near future.

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

Dependencies

In Progress

License

Modified BSD license

Examples

See the docs for more detailed examples.

>>> 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'
>>> from github3 import login
>>> g = login(username, password)
>>> repo = g.repository('sigmavirus24', 'github3.py')
>>> tag = repo.tag('cdba84b4fede2c69cb1ee246b33f49f19475abfa')
>>> tag
<Tag [cdba84b4fede2c69cb1ee246b33f49f19475abfa]>
>>> tag.object.sha
u'24ea44d302c6394a0372dcde8fd8aed899c0034b'
>>> tag.object.type
u'commit'

Author

Ian Cordasco (sigmavirus24)

0.1: 2012-06-xx

  • Support for the complete GitHub API

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

github3.py-0.1a2.tar.gz (39.7 kB view details)

Uploaded Source

File details

Details for the file github3.py-0.1a2.tar.gz.

File metadata

  • Download URL: github3.py-0.1a2.tar.gz
  • Upload date:
  • Size: 39.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for github3.py-0.1a2.tar.gz
Algorithm Hash digest
SHA256 b0cf23518e3703c6cd18f2b42ac25ee446a6b88ce73eea304e8e4299fa865cbe
MD5 453f7c688c4ef21f4c1553bc89c3c40a
BLAKE2b-256 1ca14e03c023cdb9736cc255450d8bc2f3ca2f1dff57ce61f4a9d8e99c6ed399

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page