github

GitHub data related.

class afwf_github.github.UserType[source]
class afwf_github.github.AccountType[source]
class afwf_github.github.RepoType[source]
afwf_github.github.get_username(gh: Github) UserType[source]

Return the id and display name for the authenticated GitHub user.

This is a single lightweight API call used to determine the per-user data directory before any heavier operations run. id is the GitHub login (used for directory names and cache keys); name is the human-readable display name.

afwf_github.github.take(iterable: Iterable, n: int) list[source]

Return first n items of the iterable as a list.

Example:

>>> take([0, 1, 2], 2)
[0, 1]
afwf_github.github.fetch_data(gh: Github, page_limit: int = 9999, verbose: bool = False) tuple[UserType, list[AccountType], list[RepoType]][source]

Pull user, accounts, and repos from the GitHub API. No caching. Each API call is treated as potentially failing and raises a descriptive RuntimeError on unexpected errors. 403 responses on individual orgs or repos are silently skipped — the user simply lacks permission for those.

afwf_github.github.download_data(gh: Github, cache: Cache, username: str, expire: int, page_limit: int = 9999, verbose: bool = False) tuple[UserType, list[AccountType], list[RepoType]][source]

Pull data from GitHub via fetch_data() and store results in cache under per-username keys (e.g. repos@alice).