Python + CLI helpers for GitHub Projects task ownership
Project description
gh-task
Python + CLI helpers for taking, moving, and releasing GitHub Project (v2) issues using a lightweight ownership label protocol.
Install (local)
pip install -e .
Prerequisites
gh must be installed and authenticated (the library uses it to fetch a token if no GH_TOKEN/GITHUB_TOKEN is set).
Auth
Uses GH_TOKEN or GITHUB_TOKEN if set, otherwise falls back to gh auth token. Ensure the token has the project scope for Project v2 access.
Python usage
from gh_task import Project
project = Project(
project="https://github.com/users/yieldthought/projects/3/views/1",
name="my-name",
has_label=["bug", "help wanted"],
)
# list status columns (project can be a short ref or full URL)
print(project.list())
# list issue numbers in Backlog
print(project.list("Backlog"))
# take a specific issue (number, URL, or owner/repo#number)
issue_id = project.take(2)
# take the first available issue in Backlog that matches the label filter
issue_id = project.take("Backlog")
# move and release
project.move(2, "In review")
project.release(2)
# context-managed lease (auto-release on exit)
with project.lease("Backlog") as issue:
print(issue.number)
CLI
# list status columns
gh-task list -p yieldthought/projects/3 -n my-name
# list issues in Backlog
gh-task list -p yieldthought/projects/3 -n my-name Backlog
# take a specific issue
gh-task take -p yieldthought/projects/3 -n my-name -i 2
# take the first available issue in Backlog
gh-task take -p yieldthought/projects/3 -n my-name -l "bug,help wanted" Backlog
# move and release
gh-task move -p yieldthought/projects/3 -n my-name -i 2 -s "In review"
gh-task release -p yieldthought/projects/3 -n my-name -i 2
Label filtering
has_label (or --label/-l) restricts .list() and .take() to issues that carry at least one of the provided labels.
When taking a specific issue, a TakeError is raised if it does not match the filter.
Ownership protocol
take() performs the following:
- Verify there is no label starting with
owner:. - Add a comment
Taking: <name>. - Wait 1s (configurable) and fetch all comments beginning with
Taking:. - If the earliest
Taking:comment is yours, addowner: <name>label. - Remove your
Taking:comment (best-effort).
If any step fails, the comment is removed and a TakeError is raised.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gh_task-0.1.5.tar.gz.
File metadata
- Download URL: gh_task-0.1.5.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66b7e2cd2f7bdb18d6a6c317a6aa6f7c761500d0d98878d8d0d17935291a5b46
|
|
| MD5 |
384bfda1a28b7250de0a43357f361207
|
|
| BLAKE2b-256 |
35c08819def8a1baf65cb40bcb29c7932e3f50ecf855f24f90379b8e6d7f11e4
|
Provenance
The following attestation bundles were made for gh_task-0.1.5.tar.gz:
Publisher:
workflow.yml on yieldthought/gh-task
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gh_task-0.1.5.tar.gz -
Subject digest:
66b7e2cd2f7bdb18d6a6c317a6aa6f7c761500d0d98878d8d0d17935291a5b46 - Sigstore transparency entry: 853880188
- Sigstore integration time:
-
Permalink:
yieldthought/gh-task@6d6e7f24cea83deec0e523c3aeedb709158629a8 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/yieldthought
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@6d6e7f24cea83deec0e523c3aeedb709158629a8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file gh_task-0.1.5-py3-none-any.whl.
File metadata
- Download URL: gh_task-0.1.5-py3-none-any.whl
- Upload date:
- Size: 13.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28afa0552fbab304c7eef4f63be460ee20d9fa3496994d6938c3acc9da2e6e3c
|
|
| MD5 |
8cbe1684493f32e534fe0a1bdef932fe
|
|
| BLAKE2b-256 |
13be8e36542b8203cfef7547a34be9eda528bd99f54aaca8df2323fcc108bfd4
|
Provenance
The following attestation bundles were made for gh_task-0.1.5-py3-none-any.whl:
Publisher:
workflow.yml on yieldthought/gh-task
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gh_task-0.1.5-py3-none-any.whl -
Subject digest:
28afa0552fbab304c7eef4f63be460ee20d9fa3496994d6938c3acc9da2e6e3c - Sigstore transparency entry: 853880192
- Sigstore integration time:
-
Permalink:
yieldthought/gh-task@6d6e7f24cea83deec0e523c3aeedb709158629a8 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/yieldthought
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@6d6e7f24cea83deec0e523c3aeedb709158629a8 -
Trigger Event:
push
-
Statement type: