MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / fetch_github_info

Function fetch_github_info

web_programming/fetch_github_info.py:44–52  ·  view source on GitHub ↗

Fetch GitHub info of a user using the httpx module

(auth_token: str)

Source from the content-addressed store, hash-verified

42
43
44def 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
55if __name__ == "__main__": # pragma: no cover

Callers 2

test_fetch_github_infoFunction · 0.85

Calls 2

jsonMethod · 0.80
getMethod · 0.45

Tested by 1

test_fetch_github_infoFunction · 0.68