Skip to main content

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)

# create a new issue and add it to the project
issue = project.create(
    title="Investigate latency spikes",
    description="See logs from Jan 24",
    status="Backlog",
    repo="yieldthought/gh-task",  # optional if the project has a single repo
    label="bug",
)

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

# create a new issue and add it to the project (repo inferred if possible)
 gh-task create -p yieldthought/projects/3 -r yieldthought/gh-task -t "Fix retry logic" -d "Add jitter + cap"
 gh-task create -p yieldthought/projects/3 -t "Investigate latency spikes" -s Backlog --label bug

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:

  1. Verify there is no label starting with owner:.
  2. Add a comment Taking: <name>.
  3. Wait 1s (configurable) and fetch all comments beginning with Taking:.
  4. If the earliest Taking: comment is yours, add owner: <name> label.
  5. Remove your Taking: comment (best-effort).

If any step fails, the comment is removed and a TakeError is raised.

Metadata

Release files for gh-task 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gh-task 0.1.7
File Size Uploaded
gh_task-0.1.7.tar.gz 14.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gh-task 0.1.7
File Interpreter ABI Platform
gh_task-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 29.3 kB

Release files / gh_task-0.1.7.tar.gz

Download URL gh_task-0.1.7.tar.gz
Size 14.5 kB
Tags Source
SHA-256 checksum
How to use checksums
61aed6c7003e44a55cc9395556428c523710499b4d1cfd345eacd20034b016d3
BLAKE2b-256 checksum
How to use checksums
75bacb31c723795323b1d5beead9a5daa21f401d8ea43752bb20dae75f9a3d01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 26, 2026.

Transparency log

Release files / gh_task-0.1.7-py3-none-any.whl

Download URL gh_task-0.1.7-py3-none-any.whl
Size 14.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bbe191ca06a305ec59ccfbe3c94f7a1f43c358aadc068f15f8644bf82d143b5b
BLAKE2b-256 checksum
How to use checksums
db09640f88212cb2b02cc46d67f260d638e2f3e4df72472579b608ae4b7bd27d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 26, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page