Skip to main content

update_lib

Fetches the current watcher count for a GitHub repository via the GitHub API and updates the provided library object with the star count. The function includes a recursive retry mechanism for 403 status codes and performs network I/O using a global session object.

def update_lib(
lib: dict,
retry: int = 0
) - > null

Fetches the current star count for a GitHub repository and updates the provided library object with the result. This function performs an authenticated network request and includes a retry mechanism to handle rate limiting (403 status codes).

Parameters

NameTypeDescription
libdictA dictionary representing a library, which must contain a 'repo' key with the GitHub repository path (e.g., 'owner/name').
retryint = 0The current attempt count used to manage recursive retries when encountering GitHub API rate limits.

Returns

TypeDescription
nullNothing; the function modifies the input library dictionary in-place by setting the 'stars' key.