Fetch GitHub info of a user using the httpx module
(auth_token: str)
| 42 | |
| 43 | |
| 44 | def fetch_github_info(auth_token: str) -> dict[Any, Any]: |
| 45 | """ |
| 46 | Fetch GitHub info of a user using the httpx module |
| 47 | """ |
| 48 | headers = { |
| 49 | "Authorization": f"token {auth_token}", |
| 50 | "Accept": "application/vnd.github.v3+json", |
| 51 | } |
| 52 | return httpx.get(AUTHENTICATED_USER_ENDPOINT, headers=headers, timeout=10).json() |
| 53 | |
| 54 | |
| 55 | if __name__ == "__main__": # pragma: no cover |