Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
44 lines (30 sloc) 1.4 KB


Once :mod:`github2` is :doc:`installed <install>` we can open an interactive Python session and perform some basic tasks to familiarise ourselves with the package.

Create an unauthenticated client object:

>>> from github2.client import Github
>>> github = Github()


Creating an unauthenticated client object means we can play with the API without fear of creating or deleting data on our account.

See how many followers the :mod:`github2` project has:

>>> len(github.repos.watchers("ask/python-github2"))

Read the description of the python-github2 project:

>>> repo ="ask/python-github2")
>>> repo.description
u'github client in python, with issues support.'

We can take advantage of Python's :func:`dir` to explore the package a little more:

>>> filter(lambda s: not s.startswith("_"), dir(github.users))
['domain', 'follow', 'followers', 'following', 'get_value', 'get_values',
 'make_request', 'request', 'search', 'search_by_email', 'show',

For more information on specific functionality see the :doc:`api/index`, and the copious examples contained within.

Jump to Line
Something went wrong with that request. Please try again.