github_repository
appimage_updater.repositories.github_repository
¶
GitHub repository implementation for the repositories package.
This module re-exports the GitHubRepository class from the github package to maintain the repository abstraction pattern.
GitHubRepository(timeout=30, user_agent=None, auth=None, token=None, **kwargs)
¶
GitHub repository implementation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
timeout
|
int
|
Request timeout in seconds |
30
|
user_agent
|
str | None
|
Custom user agent string |
None
|
auth
|
GitHubAuth | None
|
GitHubAuth instance for authentication |
None
|
token
|
str | None
|
Explicit GitHub token (creates auth if provided) |
None
|
**kwargs
|
Any
|
Additional configuration options |
{}
|
Source code in src/appimage_updater/github/repository.py
github_client
property
¶
Get the underlying GitHub client for backward compatibility.
repository_type
property
¶
Get the repository type identifier.
detect_repository_type(url)
¶
Check if this is a GitHub repository URL.
Source code in src/appimage_updater/github/repository.py
fetch_appimage_pattern_from_github(url)
async
¶
Async function to fetch AppImage pattern from repository releases.
Looks for both direct AppImage files and ZIP files that might contain AppImages. Prioritizes stable releases over prereleases for better pattern generation.
Source code in src/appimage_updater/github/repository.py
generate_pattern_from_releases(url)
async
¶
Generate file pattern from actual GitHub releases.
get_latest_release(repo_url)
async
¶
Get the latest stable release for a GitHub repository.
Source code in src/appimage_updater/github/repository.py
get_latest_release_including_prerelease(repo_url)
async
¶
Get the latest release including prereleases for a GitHub repository.
Source code in src/appimage_updater/github/repository.py
get_releases(repo_url, limit=10)
async
¶
Get recent releases for a GitHub repository.
Source code in src/appimage_updater/github/repository.py
normalize_github_url(url)
¶
Normalize GitHub URL to repository format and detect if it was corrected.
Detects GitHub download URLs (releases/download/...) and converts them to repository URLs. Returns (normalized_url, was_corrected) tuple.
Source code in src/appimage_updater/github/repository.py
normalize_repo_url(url)
¶
Normalize GitHub URL to repository format and detect if it was corrected.
parse_repo_url(url)
¶
Parse GitHub repository URL to extract owner and repo name.
Source code in src/appimage_updater/github/repository.py
should_enable_prerelease(url)
async
¶
Check if prerelease should be automatically enabled for a repository.
Returns True if the repository only has prerelease versions (like continuous builds) and no stable releases, indicating that prerelease support should be enabled.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url
|
str
|
Repository URL |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if only prereleases are found, False if stable releases exist or on error |