ghops (DEPRECATED)
raw JSON → 1.0.0 verified Sat May 09 auth: no python deprecated
Deprecated Python library for GitHub repository operations. Version 1.0.0 is the final release. Users should migrate to repoindex (https://pypi.org/project/repoindex/), which supersedes ghops with expanded features including MCP server, export commands, and support for Gitea/Codeberg.
pip install ghops Common errors
error AttributeError: module 'ghops' has no attribute 'GHOps' ↓
cause Typo or incorrect import (e.g., from ghops import ... but class is GHOps).
fix
Use 'from ghops import GHOps' (capital G, H, O).
error HTTPError: 401 Unauthorized when calling GitHub API ↓
cause Missing or invalid GITHUB_TOKEN environment variable.
fix
Set GITHUB_TOKEN to a valid GitHub personal access token before importing.
error TypeError: __init__() missing 1 required positional argument: 'token' ↓
cause GHOps constructor requires token argument.
fix
Provide token: GHOps(token='your_token')
Warnings
deprecated ghops is deprecated and will not receive updates or bug fixes. Migrate to repoindex. ↓
fix pip install repoindex and update imports: from repoindex import ...
gotcha GHOps token authentication fails silently if GITHUB_TOKEN is not set or invalid, returning empty results. ↓
fix Always verify token validity: raise error if token is empty or response is 401.
gotcha List method pagination is not automatically handled; you must manually iterate pages. ↓
fix Use the `page` parameter in list methods or paginate with a loop.
Imports
- GHOps
from ghops import GHOps
Quickstart
from ghops import GHOps
import os
token = os.environ.get('GITHUB_TOKEN', '')
if not token:
raise ValueError('GITHUB_TOKEN environment variable is required')
gh = GHOps(token=token)
print(gh.list_repos())