MCPcopy Index your code
hub / github.com/PyGithub/PyGithub / Github

Class Github

github/MainClass.py:159–1053  ·  view source on GitHub ↗

This is the main class you instantiate to access the Github API v3. Optional parameters allow different authentication methods.

Source from the content-addressed store, hash-verified

157
158
159class Github:
160 """
161 This is the main class you instantiate to access the Github API v3.
162
163 Optional parameters allow different authentication methods.
164
165 """
166
167 __requester: Requester
168
169 default_retry = GithubRetry()
170
171 # keep non-deprecated arguments in-sync with Requester
172 # v3: remove login_or_token, password, jwt and app_auth
173 # v3: move auth to the front of arguments
174 # v3: add * before first argument so all arguments must be named,
175 # allows to reorder / add new arguments / remove deprecated arguments without breaking user code
176 def __init__(
177 self,
178 login_or_token: str | None = None,
179 password: str | None = None,
180 jwt: str | None = None,
181 app_auth: AppAuthentication | None = None,
182 base_url: str = Consts.DEFAULT_BASE_URL,
183 timeout: int = Consts.DEFAULT_TIMEOUT,
184 user_agent: str = Consts.DEFAULT_USER_AGENT,
185 per_page: int = Consts.DEFAULT_PER_PAGE,
186 verify: bool | str = True,
187 retry: int | Retry | None = default_retry,
188 pool_size: int | None = None,
189 seconds_between_requests: float | None = Consts.DEFAULT_SECONDS_BETWEEN_REQUESTS,
190 seconds_between_writes: float | None = Consts.DEFAULT_SECONDS_BETWEEN_WRITES,
191 auth: github.Auth.Auth | None = None,
192 # v3: set lazy = True as the default
193 lazy: bool = False,
194 ) -> None:
195 """
196 :param login_or_token: string deprecated, use auth=github.Auth.Login(...) or auth=github.Auth.Token(...) instead
197 :param password: string deprecated, use auth=github.Auth.Login(...) instead
198 :param jwt: string deprecated, use auth=github.Auth.AppAuth(...) or auth=github.Auth.AppAuthToken(...) instead
199 :param app_auth: github.AppAuthentication deprecated, use auth=github.Auth.AppInstallationAuth(...) instead
200 :param base_url: string
201 :param timeout: integer
202 :param user_agent: string
203 :param per_page: int
204 :param verify: boolean or string
205 :param retry: int or urllib3.util.retry.Retry object,
206 defaults to github.Github.default_retry,
207 set to None to disable retries
208 :param pool_size: int
209 :param seconds_between_requests: float
210 :param seconds_between_writes: float
211 :param auth: authentication method
212 :param lazy: completable objects created from this instance are lazy,
213 as well as completable objects created from those, and so on
214 """
215
216 assert login_or_token is None or isinstance(login_or_token, str), login_or_token

Callers 3

testOtherUrlMethod · 0.90
testOtherPortMethod · 0.90
withLazyMethod · 0.70

Calls 1

GithubRetryClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…