functional
Class info¶
🛈 DocStrings¶
add_pull_request_comment_async
async
¶
add_pull_request_comment_async(url: str, number: int, body: str) -> Comment
Add a general comment to a pull request.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Repository URL |
required |
number
|
int
|
Pull request number |
required |
body
|
str
|
Comment text |
required |
Returns:
| Type | Description |
|---|---|
Comment
|
Created comment |
Source code in src/githarbor/functional.py
add_pull_request_review_comment_async
async
¶
add_pull_request_review_comment_async(
url: str, number: int, body: str, commit_id: str, path: str, position: int
) -> Comment
Add a review comment to specific line in a pull request.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Repository URL |
required |
number
|
int
|
Pull request number |
required |
body
|
str
|
Comment text |
required |
commit_id
|
str
|
The SHA of the commit to comment on |
required |
path
|
str
|
The relative path to the file to comment on |
required |
position
|
int
|
Line number in the file to comment on |
required |
Returns:
| Type | Description |
|---|---|
Comment
|
Created comment |
Source code in src/githarbor/functional.py
compare_branches_async
async
¶
compare_branches_async(
url: str,
base: str,
head: str,
*,
include_commits: bool = True,
include_files: bool = True,
include_stats: bool = True,
) -> dict[str, Any]
Compare two branches.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Repository URL |
required |
base
|
str
|
Base branch name |
required |
head
|
str
|
Head branch name |
required |
include_commits
|
bool
|
Whether to include commit information |
True
|
include_files
|
bool
|
Whether to include changed files |
True
|
include_stats
|
bool
|
Whether to include statistics |
True
|
Source code in src/githarbor/functional.py
create_branch_async
async
¶
create_branch_async(url: str, name: str, base_commit: str) -> Branch
Create a new branch at the specified commit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Repository URL |
required |
name
|
str
|
Name of the branch to create |
required |
base_commit
|
str
|
SHA of the commit to base the branch on |
required |
Returns:
| Type | Description |
|---|---|
Branch
|
Created branch |
Source code in src/githarbor/functional.py
create_issue_async
async
¶
create_issue_async(
url: str,
title: str,
body: str,
*,
labels: list[str] | None = None,
assignees: list[str] | None = None,
) -> Issue
Create a new issue.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Repository URL |
required |
title
|
str
|
Issue title |
required |
body
|
str
|
Issue description/content |
required |
labels
|
list[str] | None
|
List of label names to apply |
None
|
assignees
|
list[str] | None
|
List of usernames to assign |
None
|
Returns:
| Type | Description |
|---|---|
Issue
|
Newly created issue |
Source code in src/githarbor/functional.py
create_pull_request_async
async
¶
create_pull_request_async(
url: str, title: str, body: str, head_branch: str, base_branch: str, draft: bool = False
) -> PullRequest
Create a new pull request.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Repository URL |
required |
title
|
str
|
Pull request title |
required |
body
|
str
|
Pull request description |
required |
head_branch
|
str
|
Source branch containing the changes |
required |
base_branch
|
str
|
Target branch for the changes |
required |
draft
|
bool
|
Whether to create a draft pull request |
False
|
Returns:
| Type | Description |
|---|---|
PullRequest
|
Newly created pull request |
Source code in src/githarbor/functional.py
create_pull_request_from_diff_async
async
¶
create_pull_request_from_diff_async(
url: str,
title: str,
body: str,
base_branch: str,
diff: str,
head_branch: str | None = None,
draft: bool = False,
) -> PullRequest
Create a pull request from a diff string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Repository URL |
required |
title
|
str
|
Pull request title |
required |
body
|
str
|
Pull request description |
required |
base_branch
|
str
|
Target branch for the changes |
required |
diff
|
str
|
Git diff string |
required |
head_branch
|
str | None
|
Name of the branch to create. Auto-generated if not provided. |
None
|
draft
|
bool
|
Whether to create a draft pull request |
False
|
Returns:
| Type | Description |
|---|---|
PullRequest
|
Created pull request |
Source code in src/githarbor/functional.py
create_repository_async
async
¶
create_repository_async(
url: str, name: str, description: str = "", private: bool = False
) -> BaseRepository
Create a new repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Owner URL |
required |
name
|
str
|
Repository name |
required |
description
|
str
|
Repository description |
''
|
private
|
bool
|
Whether to create a private repository |
False
|
Source code in src/githarbor/functional.py
delete_repository_async
async
¶
Delete a repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Owner URL |
required |
name
|
str
|
Repository name to delete |
required |
Source code in src/githarbor/functional.py
download_async
async
¶
download_async(
url: str, path: str, destination: JoinablePathLike, *, recursive: bool = False
) -> None
Download repository content.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Repository URL |
required |
path
|
str
|
Path to download |
required |
destination
|
JoinablePathLike
|
Where to save the downloaded content |
required |
recursive
|
bool
|
Whether to download recursively |
False
|
Source code in src/githarbor/functional.py
get_branch_async
async
¶
get_branch_async(url: str, name: str) -> Branch
Get information about a specific repository branch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Repository URL |
required |
name
|
str
|
Branch name |
required |
Source code in src/githarbor/functional.py
get_commit_async
async
¶
get_commit_async(url: str, sha: str) -> Commit
Get information about a specific commit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Repository URL |
required |
sha
|
str
|
Commit SHA |
required |
get_contributors_async
async
¶
get_contributors_async(
url: str, *, sort_by: Literal["commits", "name", "date"] = "commits", limit: int | None = None
) -> list[User]
Get repository contributors.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Repository URL |
required |
sort_by
|
Literal['commits', 'name', 'date']
|
How to sort the contributors |
'commits'
|
limit
|
int | None
|
Maximum number of contributors to return |
None
|
Source code in src/githarbor/functional.py
get_issue_async
async
¶
get_issue_async(url: str, issue_id: int) -> Issue
Get information about a specific issue.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Repository URL |
required |
issue_id
|
int
|
Issue number |
required |
Source code in src/githarbor/functional.py
get_languages_async
async
¶
Get repository language statistics.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Repository URL |
required |
get_latest_release_async
async
¶
get_latest_release_async(
url: str, *, include_drafts: bool = False, include_prereleases: bool = False
) -> Release
Get latest repository release.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Repository URL |
required |
include_drafts
|
bool
|
Whether to include draft releases |
False
|
include_prereleases
|
bool
|
Whether to include pre-releases |
False
|
Source code in src/githarbor/functional.py
get_pull_request_async
async
¶
get_pull_request_async(url: str, number: int) -> PullRequest
Get information about a specific pull request.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Repository URL |
required |
number
|
int
|
Pull request number |
required |
Source code in src/githarbor/functional.py
get_release_async
async
¶
get_release_async(url: str, tag: str) -> Release
Get release by tag.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Repository URL |
required |
tag
|
str
|
Release tag name |
required |
get_repo_user_async
async
¶
get_repo_user_async(url: str) -> User
Get repository owner information.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Repository URL |
required |
get_tag_async
async
¶
get_tag_async(url: str, name: str) -> Tag
Get tag information.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Repository URL |
required |
name
|
str
|
Tag name |
required |
get_user_async
async
¶
get_user_async(url: str) -> User
Get user information.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
User URL |
required |
get_workflow_async
async
¶
get_workflow_async(url: str, workflow_id: str) -> Workflow
Get information about a specific workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Repository URL |
required |
workflow_id
|
str
|
Workflow identifier |
required |
Source code in src/githarbor/functional.py
get_workflow_run_async
async
¶
get_workflow_run_async(url: str, run_id: str) -> WorkflowRun
Get information about a specific workflow run.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Repository URL |
required |
run_id
|
str
|
Workflow run identifier |
required |
Source code in src/githarbor/functional.py
list_branches_async
async
¶
list_branches_async(url: str) -> list[Branch]
List all branches in a repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Repository URL |
required |
Returns:
| Type | Description |
|---|---|
list[Branch]
|
List of branches |
list_commits_async
async
¶
list_commits_async(
url: str,
*,
branch: str | None = None,
since: datetime | None = None,
until: datetime | None = None,
author: str | None = None,
path: str | None = None,
max_results: int | None = None,
) -> list[Commit]
List repository commits with optional filters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Repository URL |
required |
branch
|
str | None
|
Filter by branch name |
None
|
since
|
datetime | None
|
Only show commits after this date |
None
|
until
|
datetime | None
|
Only show commits before this date |
None
|
author
|
str | None
|
Filter by author |
None
|
path
|
str | None
|
Filter by file path |
None
|
max_results
|
int | None
|
Maximum number of results |
None
|
Source code in src/githarbor/functional.py
list_issues_async
async
¶
list_issues_async(url: str, *, state: IssueState = 'open') -> list[Issue]
List repository issues.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Repository URL |
required |
state
|
IssueState
|
Issue state filter ('open', 'closed', 'all') |
'open'
|
Source code in src/githarbor/functional.py
list_pull_requests_async
async
¶
list_pull_requests_async(url: str, *, state: PullRequestState = 'open') -> list[PullRequest]
List repository pull requests.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Repository URL |
required |
state
|
PullRequestState
|
Pull request state filter ('open', 'closed', 'all') |
'open'
|
Source code in src/githarbor/functional.py
list_releases_async
async
¶
list_releases_async(
url: str,
*,
include_drafts: bool = False,
include_prereleases: bool = False,
limit: int | None = None,
) -> list[Release]
List repository releases.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Repository URL |
required |
include_drafts
|
bool
|
Whether to include draft releases |
False
|
include_prereleases
|
bool
|
Whether to include pre-releases |
False
|
limit
|
int | None
|
Maximum number of releases to return |
None
|
Source code in src/githarbor/functional.py
list_repositories_async
async
¶
list_repositories_async(url: str) -> list[BaseRepository]
List repositories owned by user/organization.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Owner URL |
required |
list_workflows_async
async
¶
list_workflows_async(url: str) -> list[Workflow]
List repository workflows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Repository URL |
required |
make_sync
¶
Convert an async function to sync using asyncio.run().
Source code in src/githarbor/functional.py
search_commits_async
async
¶
search_commits_async(
url: str,
query: str,
*,
branch: str | None = None,
path: str | None = None,
max_results: int | None = None,
) -> list[Commit]
Search repository commits.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Repository URL |
required |
query
|
str
|
Search query string |
required |
branch
|
str | None
|
Filter by branch name |
None
|
path
|
str | None
|
Filter by file path |
None
|
max_results
|
int | None
|
Maximum number of results |
None
|
Source code in src/githarbor/functional.py
setup_env
¶
Used as extension point for the jinjarope environment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
env
|
Any
|
The jinjarope environment to extend |
required |
Source code in src/githarbor/functional.py
599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 | |