aboutsummaryrefslogtreecommitdiffstats
path: root/docs/repos.rst
blob: 2a5bbe28c6322525742d438f37929c2a5bb4f1e2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
.. _Repos service:

Repos's services
===================

**Fast sample**::

    from pygithub3 import Github

    gh = Github()

    django_compressor = gh.repos.get(user='jezdez', repo='django_compressor')
    requests_collaborators = gh.repos.collaborators(user='kennethreitz',
        repo='requests')

.. _config precedence:

Config precedence
------------------

Some request always need ``user`` and ``repo`` parameters, both, to identify
a `repository`. Because there are a lot of requests which need that parameters,
you can :ref:`config each service` with ``user`` and ``repo`` globally.

So several requests follow a simple precedence ``user_in_arg > user_in_config``

You can see it better with an example: ::

    from pygithub3 import Github

    gh = Github(user='octocat', repo='oct_repo')
    oct_repo = gh.repos.get()
    another_repo_from_octocat = gh.repos.get(repo='another_repo')

    django_compressor = gh.repos.get(user='jezdez', repo='django_compressor')

.. note::

    Remember that each service is isolated from the rest ::

        # continue example...
        gh.repos.commits.set_user('copitux')
        oct_repo = gh.repos.get()
        oct_repo_collaborators = gh.repos.collaborators.list().all()

        # Fail because copitux/oct_repo doesn't exist
        gh.repos.commits.list_comments()

Repo
-------

.. autoclass:: pygithub3.services.repos.Repos
    :members:

    .. attribute:: collaborators

        :ref:`Collaborators service`

    .. attribute:: commits

        :ref:`Commits service`

    .. attribute:: downloads

        :ref:`Downloads service`

    .. attribute:: forks

        :ref:`Forks service`

    .. attribute:: keys

        :ref:`RepoKeys service`

    .. attribute:: watchers

        :ref:`Watchers service`

.. _Collaborators service:

Collaborators
--------------

.. autoclass:: pygithub3.services.repos.Collaborators

.. _Commits service:

Commits
----------

.. autoclass:: pygithub3.services.repos.Commits

.. _Downloads service:

Downloads
------------

.. autoclass:: pygithub3.services.repos.Downloads


.. _Forks service:

Forks
---------

.. autoclass:: pygithub3.services.repos.Forks


.. _RepoKeys service:

Keys
----------

.. autoclass:: pygithub3.services.repos.Keys


.. _Watchers service:

Watchers
---------

.. autoclass:: pygithub3.services.repos.Watchers

.. _github repo doc: http://developer.github.com/v3/repos