class GitHub
Bases: AbstractAsyncContextManager
Source code in async_py_octocat/_github.py
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 |
|
__init__(username, token, is_token_auth=False)
#
Async GitHub client.
All async calls to methods of this object and objects created with calls to methods of instance of this object should be done within async with code block.
Objects created by this objects are bound to this object and are able to communicate with Github API only by this object session (async with block) unless manually rebound to different object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
username |
str
|
Github account user name. |
required |
token |
str
|
Access token for same account as username was. |
required |
is_token_auth |
bool, optional
|
When True, token only authentication is used, basic auth otherwise, by default False |
False
|
Source code in async_py_octocat/_github.py
repository(user_name, repo_name)
async
#
Request github repository owned by user_name
with name
repo_name
. It is alternative to first requesting user and then
requesting repo using User object API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
user_name |
str
|
Name of owner of repo. |
required |
repo_name |
str
|
Name of repository requested. |
required |
Returns:
Type | Description |
---|---|
Repository
|
Wrapper object containing details of repo and allowing for further API interaction. |
Source code in async_py_octocat/_github.py
user(username=None)
async
#
Request github user details from Github API. This function requires
internet connection, thus have to be called within async
with
block.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
username |
Optional[str], optional
|
Login of user to acquire, when none, details for currently authenticated user are returned. |
None
|
Returns:
Type | Description |
---|---|
User
|
Wrapper object containing user details and allowing for further API interaction. |
Source code in async_py_octocat/_github.py
Created: July 3, 2022