# GitHub Client SDK
The **GitHub Client** is a robust Python library designed for seamless interaction with the GitHub API. It offers an intuitive interface for managing GitHub workflows, environment variables, and various repository actions. This SDK simplifies automation tasks such as workflow management and environment variable configuration, making it ideal for developers looking to integrate GitHub operations into their Python projects.
## Features
- **Workflow Management**: Effortlessly create, list, and delete GitHub Actions workflows.
- **Environment Variable Management**: Create and update environment variables for GitHub Actions workflows.
- **OAuth Authentication**: Secure OAuth authentication for accessing GitHub repositories and performing operations.
- **Easy Integration**: Lightweight and easy to integrate into your existing Python projects.
- **Extensible**: Designed for further extensions and customization as per your workflow automation needs.
## Installation
To install and set up the **GitHub Client**, clone the repository and install the required dependencies:
```bash
git clone https://github.com/azimhossaintuhin/github-client-sdk.git
cd github-client-sdk
pip install -r requirements.txt
```
### Requirements
- Python 3.9 or higher
- `httpx` library (installed via `requirements.txt`)
- A GitHub account and OAuth token for authentication
## Usage
### Authentication
To use the SDK, you need to authenticate via OAuth using your GitHub credentials. Follow the steps below:
```python
from Github.auth import AuthClient
authClient = AuthClient(
client_id="your_client_id",
client_secret="your_client_secret",
redirect_uri="your_redirect_uri",
scope=[user:email]
)
auth_url = authClient.get_auth_url()
print(f"Please visit this URL to authorize the application: {auth_url}")
code = input("Enter the Code you received after authorization: ")
token = authClient.get_access_token(code)
user_info = authClient.get_user_info(token)
```
### Working with Workflows
You can interact with GitHub Actions workflows in your repository using the `Workflow` class.
#### List Workflows
To retrieve and list all workflows in a repository:
```python
import httpx
from Github.client import GitHubClient
from Github.workflow import Workflow
client = GitHubClient(token="your_oauth_token", client=httpx)
workflow = Workflow(client, "your_github_username", "your_repository_name")
workflows = workflow.get_workflows("your_github_username", "your_repository_name")
print(workflows)
```
#### Create Workflow
To create a new workflow in the specified repository:
```python
workflow_name = "my_new_workflow"
workflow_path = "path/to/your/workflow.yml"
response = workflow.create_workflow(workflow_name, workflow_path)
print(f"Workflow created successfully: {response}")
```
#### Delete Workflow
To delete a specific workflow by its ID:
```python
workflow_id = "your_workflow_id"
workflow.delete_workflow(workflow_id)
print(f"Workflow {workflow_id} deleted successfully.")
```
### Working with Environment Variables
The SDK also allows you to manage environment variables for your workflows.
#### Create Variable
To create a new environment variable:
```python
import httpx
from Github.variables import VariableClient
variable_client = VariableClient(client, "your_github_username", "your_repository_name")
response = variable_client.create_variable("MY_ENV_VAR", "my_value")
print(f"Environment variable created: {response}")
```
#### Update Variable
To update the value of an existing environment variable:
```python
response = variable_client.update_variable("MY_ENV_VAR", "new_value")
print(f"Environment variable updated: {response}")
```
## Contributing
We welcome contributions to the **GitHub Client SDK**. If you'd like to contribute, please follow the steps below:
1. Fork the repository.
2. Create a new branch for your feature or bugfix (`git checkout -b feature-branch`).
3. Commit your changes with a clear and concise message (`git commit -am 'Add new feature'`).
4. Push your changes to your fork (`git push origin feature-branch`).
5. Create a pull request explaining your changes.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Acknowledgments
- [GitHub API Documentation](https://docs.github.com/en/rest)
- [Python httpx Library](https://www.python-httpx.org/)
- [GitHub Actions](https://docs.github.com/en/actions)
Raw data
{
"_id": null,
"home_page": null,
"name": "github-client-sdk",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "github, api, sdk, client",
"author": "Azim Hossain Tuhin",
"author_email": "codeocmmerze@example.com",
"download_url": "https://files.pythonhosted.org/packages/89/51/d2fa9957b48267f02290157d1edcf77d0a37d8554f44af486c8df08d70dd/github_client_sdk-1.1.0.tar.gz",
"platform": null,
"description": "\n# GitHub Client SDK\n\nThe **GitHub Client** is a robust Python library designed for seamless interaction with the GitHub API. It offers an intuitive interface for managing GitHub workflows, environment variables, and various repository actions. This SDK simplifies automation tasks such as workflow management and environment variable configuration, making it ideal for developers looking to integrate GitHub operations into their Python projects.\n\n## Features\n\n- **Workflow Management**: Effortlessly create, list, and delete GitHub Actions workflows.\n- **Environment Variable Management**: Create and update environment variables for GitHub Actions workflows.\n- **OAuth Authentication**: Secure OAuth authentication for accessing GitHub repositories and performing operations.\n- **Easy Integration**: Lightweight and easy to integrate into your existing Python projects.\n- **Extensible**: Designed for further extensions and customization as per your workflow automation needs.\n\n## Installation\n\nTo install and set up the **GitHub Client**, clone the repository and install the required dependencies:\n\n```bash\ngit clone https://github.com/azimhossaintuhin/github-client-sdk.git\ncd github-client-sdk\npip install -r requirements.txt\n```\n\n### Requirements\n\n- Python 3.9 or higher\n- `httpx` library (installed via `requirements.txt`)\n- A GitHub account and OAuth token for authentication\n\n## Usage\n\n### Authentication\n\nTo use the SDK, you need to authenticate via OAuth using your GitHub credentials. Follow the steps below:\n\n```python\nfrom Github.auth import AuthClient\n\nauthClient = AuthClient(\n client_id=\"your_client_id\",\n client_secret=\"your_client_secret\",\n redirect_uri=\"your_redirect_uri\",\n scope=[user:email]\n)\n\nauth_url = authClient.get_auth_url()\nprint(f\"Please visit this URL to authorize the application: {auth_url}\")\ncode = input(\"Enter the Code you received after authorization: \")\ntoken = authClient.get_access_token(code)\nuser_info = authClient.get_user_info(token)\n```\n\n### Working with Workflows\n\nYou can interact with GitHub Actions workflows in your repository using the `Workflow` class.\n\n#### List Workflows\n\nTo retrieve and list all workflows in a repository:\n\n```python\nimport httpx\nfrom Github.client import GitHubClient\nfrom Github.workflow import Workflow\n\nclient = GitHubClient(token=\"your_oauth_token\", client=httpx)\nworkflow = Workflow(client, \"your_github_username\", \"your_repository_name\")\n\nworkflows = workflow.get_workflows(\"your_github_username\", \"your_repository_name\")\nprint(workflows)\n```\n\n#### Create Workflow\n\nTo create a new workflow in the specified repository:\n\n```python\nworkflow_name = \"my_new_workflow\"\nworkflow_path = \"path/to/your/workflow.yml\"\n\nresponse = workflow.create_workflow(workflow_name, workflow_path)\nprint(f\"Workflow created successfully: {response}\")\n```\n\n#### Delete Workflow\n\nTo delete a specific workflow by its ID:\n\n```python\nworkflow_id = \"your_workflow_id\"\nworkflow.delete_workflow(workflow_id)\nprint(f\"Workflow {workflow_id} deleted successfully.\")\n```\n\n### Working with Environment Variables\n\nThe SDK also allows you to manage environment variables for your workflows.\n\n#### Create Variable\n\nTo create a new environment variable:\n\n```python\nimport httpx\nfrom Github.variables import VariableClient\n\nvariable_client = VariableClient(client, \"your_github_username\", \"your_repository_name\")\n\nresponse = variable_client.create_variable(\"MY_ENV_VAR\", \"my_value\")\nprint(f\"Environment variable created: {response}\")\n```\n\n#### Update Variable\n\nTo update the value of an existing environment variable:\n\n```python\nresponse = variable_client.update_variable(\"MY_ENV_VAR\", \"new_value\")\nprint(f\"Environment variable updated: {response}\")\n```\n\n## Contributing\n\nWe welcome contributions to the **GitHub Client SDK**. If you'd like to contribute, please follow the steps below:\n\n1. Fork the repository.\n2. Create a new branch for your feature or bugfix (`git checkout -b feature-branch`).\n3. Commit your changes with a clear and concise message (`git commit -am 'Add new feature'`).\n4. Push your changes to your fork (`git push origin feature-branch`).\n5. Create a pull request explaining your changes.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n- [GitHub API Documentation](https://docs.github.com/en/rest)\n- [Python httpx Library](https://www.python-httpx.org/)\n- [GitHub Actions](https://docs.github.com/en/actions)",
"bugtrack_url": null,
"license": "MIT",
"summary": "A Python SDK for interacting with the GitHub API",
"version": "1.1.0",
"project_urls": null,
"split_keywords": [
"github",
" api",
" sdk",
" client"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "cb21b6353942bcd5866362b739c00671dc8b3be6193267a3095f028bd685fd57",
"md5": "0093d12a5f969a038684919504c6e5ac",
"sha256": "c3f1d872654b1b5d5267af37351745c357e7af1c407753118043c758673c3180"
},
"downloads": -1,
"filename": "github_client_sdk-1.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0093d12a5f969a038684919504c6e5ac",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 9375,
"upload_time": "2025-05-18T07:27:26",
"upload_time_iso_8601": "2025-05-18T07:27:26.976162Z",
"url": "https://files.pythonhosted.org/packages/cb/21/b6353942bcd5866362b739c00671dc8b3be6193267a3095f028bd685fd57/github_client_sdk-1.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8951d2fa9957b48267f02290157d1edcf77d0a37d8554f44af486c8df08d70dd",
"md5": "e0f43235a9659e7be05a7c5a2ffc6ef4",
"sha256": "4fe2151f477006ecc1f72c06f789499ed2a203716de9e400a700b67c9c0ba8d5"
},
"downloads": -1,
"filename": "github_client_sdk-1.1.0.tar.gz",
"has_sig": false,
"md5_digest": "e0f43235a9659e7be05a7c5a2ffc6ef4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 6207,
"upload_time": "2025-05-18T07:27:28",
"upload_time_iso_8601": "2025-05-18T07:27:28.743157Z",
"url": "https://files.pythonhosted.org/packages/89/51/d2fa9957b48267f02290157d1edcf77d0a37d8554f44af486c8df08d70dd/github_client_sdk-1.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-05-18 07:27:28",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "github-client-sdk"
}