Skip to content

Latest commit

 

History

History
228 lines (164 loc) · 5.69 KB

index.rst

File metadata and controls

228 lines (164 loc) · 5.69 KB

github3.py

Release v|version|.

github3.py is wrapper for the GitHub API written in python. The design of github3.py is centered around having a logical organization of the methods needed to interact with the API. Let me demonstrate this with a code example.

Example

Let's get information about a user:

from github3 import login

gh = login('sigmavirus24', password='<password>')

sigmavirus24 = gh.user()
# <User [sigmavirus24:Ian Cordasco]>

print(sigmavirus24.name)
# Ian Cordasco
print(sigmavirus24.login)
# sigmavirus24
print(sigmavirus24.followers)
# 4

for f in gh.iter_followers():
    print(str(f))

kennethreitz = gh.user('kennethreitz')
# <User [kennethreitz:Kenneth Reitz]>

print(kennethreitz.name)
print(kennethreitz.login)
print(kennethreitz.followers)

followers = [str(f) for f in gh.iter_followers('kennethreitz')]

More Examples

.. toctree::
    :maxdepth: 2

    examples/two_factor_auth
    examples/oauth
    examples/gist
    examples/git
    examples/github
    examples/issue
    examples/iterators.rst
    examples/logging
    examples/octocat


Modules

.. toctree::
    :maxdepth: 1

    api
    auths
    events
    gists
    git
    github
    issues
    models
    orgs
    pulls
    repos
    search_structs
    structs
    users

Internals

For objects you're not likely to see in practice. This is useful if you ever feel the need to contribute to the project.

.. toctree::
    :maxdepth: 1

    models
    decorators


Installation

$ pip install github3.py
# OR:
$ git clone git://github.com/sigmavirus24/github3.py.git github3.py
$ cd github3.py
$ python setup.py install

Dependencies

Contributing

I'm maintaining two public copies of the project. The first can be found on GitHub and the second on BitBucket. I would prefer pull requests to take place on GitHub, but feel free to do them via BitBucket. Please make sure to add yourself to the list of contributors in AUTHORS.rst, especially if you're going to be working on the list below.

Contributor Friendly Work

In order of importance:

Documentation

I know I'm not the best at writing documentation so if you want to clarify or correct something, please do so.

Examples

Have a clever example that takes advantage of github3.py? Feel free to share it.

Running the Unittests

mkdir -p /path/to/virtualenv/github3.py
cd /path/to/virtualenv/github3.py
virtualenv .
cd /path/to/github3.py_repo/
pip install -r dev-requirements.txt
# Or you could run make test-deps
make tests
.. toctree::

    testing


Contact

  • Twitter: @sigmavirus24
  • Private email: graffatcolmingov [at] gmail
  • Mailing list: github3.py [at] librelist.com

Testimonials

gotta hand it to @sigmavirus24 ... github3.py is really well written. It will soon be powering the github stuff on @workforpie

— Brad Montgomery # (@bkmontgomery) April 20, 2013

awesome github v3 api wrapper in python github.com/sigmavirus24/g#

— Mahdi Yusuf (@myusuf3) October 17, 2012

@sigmavirus24 github3 is awesome! Made my life much easier tonight, which is a very good thing.

— Mike Grouchy (@mgrouchy) March 26, 2013

@sigmavirus24 "There are so many Python client libraries for GitHub API, I tried all of them, and my conclusion is: github3.py is the best."

— Hong Minhee (@hongminhee) March 23, 2013

@sigmavirus24 I cannot wait to use your github package for #zci. Do you have it packaged for debian by any chance?

— Zygmunt Krynicki (@zygoon) March 26, 2013

Developing against github3.py's API is a joy, kudos to @sigmavirus24

— Alejandro Gomez (@dialelo) March 27, 2013