Source Code
countstars(json_format=False)
Counts the stars of a specified user and gives a nice comment to the user
Optional[bool] = False
decides wether json or plain text format is required
int
number of stars
Source code in professional_python_exercises_2_githubcli\github_cli.py
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 |
|
get_github_token()
Checks, if API Key is set as an environment variable. If not, the user is asked to input it in the console. Length checks enabled for the API key. If key has non-valid length (!=32) the user is asked again to enter a valid key. The key is saved into a local .env file.
str
API Key for the Open Weather Map
Source code in professional_python_exercises_2_githubcli\github_cli.py
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
|
get_user_form_input()
Method used in the app commands to get the user from user input:
user : NamedUser
Source code in professional_python_exercises_2_githubcli\github_cli.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
|
getdetails(json_format=False)
Gets the details for a specified user.
Optional[bool] = False
Decides wether nomal text output or json is required
json
Raw details in json format fron the get details request
Source code in professional_python_exercises_2_githubcli\github_cli.py
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 147 148 149 |
|
setstatus()
Sets the status to something related to this repository: Drinking tea.
bool
success if successful status change could be accomplished
Source code in professional_python_exercises_2_githubcli\github_cli.py
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 |
|