gh-toolkit
raw JSON → 0.19.1 verified Sat May 09 auth: no python
A toolkit for managing and presenting GitHub repository portfolios. Version 0.19.1, requires Python >=3.12. Actively maintained with monthly releases.
pip install gh-toolkit Common errors
error AttributeError: module 'gh_toolkit' has no attribute 'GitHubClient' ↓
cause Importing from top-level instead of submodule.
fix
Use
from gh_toolkit.github import GitHubClient. error TypeError: GitHubClient.__init__() missing 1 required positional argument: 'token' ↓
cause Passing token as positional before v0.18.0 or missing token argument.
fix
Use
GitHubClient(token='...'). Warnings
breaking The constructor signature changed in v0.18.0: now requires keyword argument 'token' instead of positional. ↓
fix Use `GitHubClient(token=os.environ.get('GITHUB_TOKEN', ''))`.
deprecated Method `get_repos()` is deprecated since v0.17.0; use `get_user_repos()` instead. ↓
fix Replace `client.get_repos('user')` with `client.get_user_repos('user')`.
gotcha The library expects a GITHUB_TOKEN environment variable by default; if not set, many calls fail with 401. ↓
fix Always set GITHUB_TOKEN or pass token explicitly.
Imports
- GitHubClient wrong
from gh_toolkit import GitHubClientcorrectfrom gh_toolkit.github import GitHubClient - Repository wrong
from gh_toolkit import Repositorycorrectfrom gh_toolkit.repository import Repository
Quickstart
import os
from gh_toolkit.github import GitHubClient
client = GitHubClient(token=os.environ.get('GITHUB_TOKEN', ''))
# List repositories for a user
repos = client.get_user_repos('octocat')
for repo in repos:
print(repo['name'])