Skip to content

Commit 9507cda

Browse files
committed
Added simple quickstart document.
1 parent 63e69c7 commit 9507cda

3 files changed

Lines changed: 38 additions & 2 deletions

File tree

doc/conf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
# Add any Sphinx extension module names here, as strings. They can be extensions
2727
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
28-
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.ifconfig']
28+
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.ifconfig', 'sphinx.ext.intersphinx']
2929

3030
# Add any paths that contain templates here, relative to this directory.
3131
templates_path = ['.templates']
@@ -218,3 +218,5 @@
218218

219219
autoclass_content = "init"
220220
autodoc_default_flags = ['members', ]
221+
222+
intersphinx_mapping = {'http://docs.python.org/': None}

doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Contents
2323
:maxdepth: 2
2424

2525
install
26+
quickstart
2627
api/index
2728
license
2829

@@ -32,4 +33,3 @@ Indices and tables
3233
* :ref:`genindex`
3334
* :ref:`modindex`
3435
* :ref:`search`
35-

doc/quickstart.rst

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Quickstart
2+
==========
3+
4+
Once ``python-github2`` is installed we can open an interactive Python session,
5+
and perform some basic tasks to familiarise ourselves with the package.
6+
7+
Create an unauthenticated client object::
8+
9+
>>> github = Github()
10+
11+
.. note::
12+
Creating an unauthenticated client object means we can play with the API
13+
without fear of creating or deleting data on our account.
14+
15+
See how many followers the ``python-github2`` project has::
16+
17+
>>> len(github.repos.watchers("ask/python-github2"))
18+
129
19+
20+
Read the description of the ``python-github2`` project::
21+
22+
>>> repo = github.repos.show("ask/python-github2")
23+
>>> repo.description
24+
25+
We can take advantage of Python's :py:func:`dir` to explore the package a
26+
little more::
27+
28+
>>> filter(lambda s: not s.startswith("_"), dir(github.users))
29+
['domain', 'follow', 'followers', 'following', 'get_value', 'get_values',
30+
'make_request', 'request', 'search', 'search_by_email', 'show',
31+
'unfollow']
32+
33+
For more information on specific functionality see the :doc:`api/index`, and the
34+
copious examples contained within.

0 commit comments

Comments
 (0)