aboutsummaryrefslogtreecommitdiffstats
path: root/docs/repos.rst
blob: c065671cb0738a706b9ae1a1689eb9577b42093f (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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
.. _Repos service:

Repos 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 | repo_in_arg > repo_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.Repo
    :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
    :members:

.. _Commits service:

Commits
----------

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

.. _Downloads service:

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

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


.. _Forks service:

Forks
---------

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


.. _RepoKeys service:

Keys
----------

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


.. _Watchers service:

Watchers
---------

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

.. _Hooks service:

Hooks
---------

.. autoclass:: pygithub3.services.repos.Hooks
    :members:

.. _github repos doc: http://developer.github.com/v3/repos
.. _github collaborators doc: http://developer.github.com/v3/repos/collaborators
.. _github commits doc: http://developer.github.com/v3/repos/commits
.. _github downloads doc: http://developer.github.com/v3/repos/downloads
.. _github forks doc: http://developer.github.com/v3/repos/forks
.. _github keys doc: http://developer.github.com/v3/repos/keys
.. _github watching doc: http://developer.github.com/v3/repos/watching
.. _github hooks doc: http://developer.github.com/v3/repos/hooks