repository
Defines a data structure for representing a repository.
Classes:
Name | Description |
---|---|
InvalidGitHubRepoURL |
Raised when a GitHub repository URL is invalid. |
InvalidRepoFullName |
Raised when a repository full name is invalid. |
RepoReference |
A reference to a repository on a code hosting platform. |
InvalidGitHubRepoURL
🔗
Bases: ValueError
Raised when a GitHub repository URL is invalid.
Source code in src/brag/repository.py
InvalidRepoFullName
🔗
Bases: ValueError
Raised when a repository full name is invalid.
Source code in src/brag/repository.py
RepoReference
🔗
Bases: BaseModel
A reference to a repository on a code hosting platform.
Attributes:
Name | Type | Description |
---|---|---|
owner |
str
|
The owner of the repository (e.g., a user or organization). |
name |
str
|
The name of the repository. |
Methods:
Name | Description |
---|---|
from_github_repo_url |
Create a RepoReference object from a GitHub repository URL. |
from_repo_full_name |
Create a RepoReference object from a RepoFullName object. |
Source code in src/brag/repository.py
full_name
property
🔗
full_name: str
Returns the full name of the repository in the format 'owner/name'.
from_github_repo_url
classmethod
🔗
from_github_repo_url(github_repo_url: GitHubRepoURL) -> Self
Create a RepoReference object from a GitHub repository URL.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
GitHubRepoURL
|
A GitHub repository URL in the format 'https://github.com/owner/name'. The URL can be HTTP or HTTPS. The URL can end with or without a trailing '.git' suffix. |
required |
Returns:
Type | Description |
---|---|
Self
|
A RepoReference object. |
Source code in src/brag/repository.py
from_repo_full_name
classmethod
🔗
from_repo_full_name(repo_full_name: RepoFullName) -> Self
Create a RepoReference object from a RepoFullName object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
RepoFullName
|
A repository full name in the format 'owner/name'. |
required |
Returns:
Type | Description |
---|---|
Self
|
A RepoReference object. |