
Security News
pnpm 10.12 Introduces Global Virtual Store and Expanded Version Catalogs
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.
Lightweight and easy-to-use Python SDK for seamless GitHub REST API integration, automation of GitHub Actions workflows, environment variable management, and OAuth authentication.
GitHub Client SDK is a powerful and easy-to-use Python library designed to simplify interaction with the GitHub REST API v3 and automate GitHub Actions workflows, environment variables, and repository management tasks.
This SDK provides a clean interface for developers, DevOps engineers, and automation specialists to seamlessly integrate GitHub operations into Python projects and CI/CD pipelines.
Install the latest version of GitHub Client SDK directly from PyPI:
pip install github-client-sdk
Or clone the repository and install dependencies:
git clone https://github.com/azimhossaintuhin/github-client-sdk.git
cd github-client-sdk
pip install -r requirements.txt
from github_client_sdk.auth import AuthClient
import os
# Initialize the auth client
auth = AuthClient(
client_id=os.getenv("CLIENT_ID"),
client_secret=os.getenv("CLIENT_SECRET"),
redirect_uri="http://localhost:8000/callback",
scope=["repo", "user:email", "workflow"]
)
# Get authentication URL
auth_url = auth.get_auth_url()
print(f"Visit this URL to authorize: {auth_url}")
# Get access token
code = input("Enter the authorization code: ")
access_token = auth.get_access_token(code)
# Get user information
user_info = auth.get_user_info(access_token)
print(user_info)
from github_client_sdk.client import GitHubClient
from github_client_sdk.workflow import Workflow
# Initialize the client
client = GitHubClient(token="your_oauth_token")
# Create workflow instance
workflow = Workflow(client, "username", "repository_name")
# Create a new workflow
workflow_name = "new-workflow"
workflow_path = "path/to/workflow.yaml"
response = workflow.create_workflow(workflow_name, workflow_path)
print(f"Workflow creation response: {response}")
# List workflows
workflows = workflow.get_workflows()
print(workflows)
# Delete workflow
workflow.delete_workflow("workflow_id")
from github_client_sdk.variables import Variables
# Initialize variables client
variables = Variables(client, "username", "repository_name")
# Get all variables
all_variables = variables.get_variables()
print(all_variables)
# Create a new variable
variables.create_variable("TEST_VARIABLE", "TEST_VALUE")
# Update an existing variable
variables.update_variable("TEST_VARIABLE", "NEW_VALUE")
# Get a specific variable
variable = variables.get_variable("TEST_VARIABLE")
print(variable)
# Delete a variable
variables.delete_variable("TEST_VARIABLE")
The SDK comes with a built-in CLI for easy interaction:
# Start the interactive shell
github-client-shell
# Available commands in the shell:
# 1. authenticate : Authenticate with GitHub
# 2. get-user-info : Fetch and display user info
# 3. set-env-variable: Set environment variables
# 4. get-env-variables: Get environment variables
# 5. logout : Logout from GitHub
# 6. clear : Clear the screen
# 7. exit : Exit the shell
The SDK requires the following environment variables to be set:
CLIENT_ID
: Your GitHub OAuth App client IDCLIENT_SECRET
: Your GitHub OAuth App client secretContributions are welcome! Please read the CONTRIBUTING.md guide before submitting a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
FAQs
Lightweight and easy-to-use Python SDK for seamless GitHub REST API integration, automation of GitHub Actions workflows, environment variable management, and OAuth authentication.
We found that github-client-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.
Security News
Amaro 1.0 lays the groundwork for stable TypeScript support in Node.js, bringing official .ts loading closer to reality.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.