GitHub API Client
GitHub API Client is a Python library for interacting with the GitHub API. It simplifies the process of fetching data about repositories, commits, contributors, pull requests, and README content.
Features
- Fetch repository information
- Fetch commits by the repository owner
- Fetch contributors to a repository
- Fetch open pull requests
- Fetch and decode the README file content
- Process commit data to check if commits were made today
- Fetch repositories of a specific user
Installation
pip install githubapiclient
Usage
Example Code
from githubapiclient import GitHubAPIClient
import json
if __name__ == "__main__":
# Replace with your GitHub token and repository owner
token = "your_personal_access_token"
repo_owner = "repository_owner"
client = GitHubAPIClient(token, repo_owner)
# Example: Get commit data for a specific repository
repo_name = "your_repository_name"
result = client.fetch_repo_info(repo_name)
print(json.dumps(result, indent=4))
Available Methods
fetch_repo_info(repo_name)- Fetch details of a specific repository.fetch_commits(repo_name)- Fetch commits by the repository owner.fetch_contributors(repo_name)- Fetch contributors to a repository.fetch_pull_requests(repo_name)- Fetch open pull requests.fetch_readme(repo_name)- Fetch and decode the README file content.fetch_user_repos()- Fetch all repositories of the user.process_commits(commits)- Process commit data for today's commits.load_commit_data(repo_name)- Load and process all repository data.
Configuration
- Replace the placeholder values for
tokenandrepo_ownerin your script with actual values. - You can generate a personal access token from GitHub under Developer Settings.
Requirements
- Python 3.6+
requestslibrary
License
This project is licensed under the MIT License.
Metadata
Release files for githubapiclient 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| githubapiclient-0.2.0.tar.gz | 3.7 kB | Without provenance | Details for githubapiclient-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| githubapiclient-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for githubapiclient-0.2.0-py3-none-any.whl |
Total release size: 8.3 kB
Release files / githubapiclient-0.2.0.tar.gz
| Download URL | githubapiclient-0.2.0.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d8fa35673b1d067942a7dcbe8604e5c6d0e5cd515e885a12d1d0b2baf9ce6eb6
|
|
BLAKE2b-256 checksum How to use checksums |
32a0aea957b7e1c10091dca82cf093073a384754bee59d057d391645f856a8e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Release files / githubapiclient-0.2.0-py3-none-any.whl
| Download URL | githubapiclient-0.2.0-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aeb1266f63a073254698009e12a43640f22674bc390008001d2111653373e02d
|
|
BLAKE2b-256 checksum How to use checksums |
33ea236e106461957d83be5f5fc8f66c76b26a81a277eb094f23a336a36d121a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Security for githubapiclient 0.2.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.