Registry / http-networking / githubpy

githubpy

JSON →
library2.0.0pypypi✓ verified 84d ago

githubpy is a straightforward Python3 client designed to interact with the GitHub REST API. Its current version is 2.0.0, released in May 2023. Despite the recent PyPI release, the underlying GitHub repository shows no active development since 2017, indicating it is likely unmaintained.

pip install githubpy
INSTALL
IMPORT
SIG · GITHUBPY
G
githubpy
http-networkingpythonv2.0.0
Install
1.5s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.8MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 1.5s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

GitHub
from github import GitHub
from githubpy.github import Github

Initializes the GitHub client with a personal access token and retrieves information about the authenticated user and their repositories. Authentication is crucial for most API interactions to avoid severe rate limits.

import os from githubpy.github import Github # It's recommended to use an environment variable for your token github_token = os.environ.get('GITHUB_TOKEN', 'YOUR_GITHUB_TOKEN') if not github_token or github_token == 'YOUR_GITHUB_TOKEN': print("WARNING: GITHUB_TOKEN environment variable not set or placeholder used. This may lead to rate limiting or authentication errors.") try: g = Github(github_token) # Get authenticated user information user_response = g.get('/user') user_response.raise_for_status() # Raise an exception for bad status codes (4xx or 5xx) user_data = user_response.json() print(f"Authenticated as: {user_data.get('login')}") # List repositories for the authenticated user repos_response = g.get('/user/repos') repos_response.raise_for_status() repos_data = repos_response.json() print("\nUser Repositories:") for repo in repos_data[:3]: # Print first 3 repos for brevity print(f"- {repo.get('name')}") except Exception as e: print(f"An error occurred: {e}") if hasattr(e, 'response') and e.response is not None: print(f"Response Status: {e.response.status_code}") print(f"Response Body: {e.response.text}")
Debug
Known issues
gotchaThis library (`githubpy`) is frequently confused with the more popular and actively maintained `PyGithub` library. They have different import paths and API structures. Ensure you are using the correct library for your project.
fix
Verify your `pip install` command and `from ... import ...` statements. If you intend to use the widely supported library, install `PyGithub` (`pip install PyGithub`) and use `from github import Github`.
affects: All
breakingDespite a PyPI release (v2.0.0) in May 2023, the official GitHub repository for `githubpy` (michaelliao/githubpy) has not been updated since August 2017. This suggests the project is effectively abandoned, and the 2.0.0 release might be a re-packaging without active code development or bug fixes.
fix
Be aware that new features, bug fixes, or compatibility updates for the latest GitHub API changes are unlikely. Consider using an actively maintained alternative like `PyGithub` for production systems.
affects: 2.0.0
gotchaUnauthenticated requests to the GitHub API are heavily rate-limited (e.g., 60 requests per hour). Most practical uses require authentication via a Personal Access Token or GitHub App.
fix
Generate a GitHub Personal Access Token with appropriate scopes (e.g., 'repo', 'read:user'). Pass this token during `Github` client initialization: `g = Github('your_token')`. Store tokens securely, preferably as environment variables, not hardcoded.
affects: All
Upgrade
Version history
2.0.0latest on PyPI · released May 2, 2023
Audit
Dependencies
requestsrequiredHTTP client for making API requests.
python-joserequiredUsed for JWT (JSON Web Token) operations, potentially for GitHub App authentication.
Agent activity
4 hits · last 30 days
node
4
Resources
githubpy — pip install githubpy · libregistry