https://github.com/xixu-me/gh-api-use
Collection of Python scripts demonstrating practical uses of the GitHub REST API for repository management and automation
https://github.com/xixu-me/gh-api-use
github-api rest-api
Last synced: 1 day ago
JSON representation
Collection of Python scripts demonstrating practical uses of the GitHub REST API for repository management and automation
- Host: GitHub
- URL: https://github.com/xixu-me/gh-api-use
- Owner: xixu-me
- License: gpl-3.0
- Created: 2025-04-02T04:31:27.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-03-09T11:13:44.000Z (4 months ago)
- Last Synced: 2026-03-09T16:06:43.956Z (4 months ago)
- Topics: github-api, rest-api
- Language: Python
- Homepage:
- Size: 30.3 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GitHub REST API Use
A collection of Python scripts demonstrating practical uses of the GitHub REST API for repository management and automation.
## Overview
This repository contains ready-to-use Python scripts for common GitHub repository management tasks that can be performed using the GitHub REST API. These scripts help automate repetitive tasks and streamline repository workflows.
## Requirements
- Python 3.6+
- `requests` library: `pip install requests`
- GitHub Personal Access Token (PAT) with appropriate permissions
## Setup
1. Clone this repository:
```bash
git clone https://github.com/username/gh-api-use.git
cd gh-api-use
```
2. Install the required Python package:
```bash
pip install requests
```
3. Create a GitHub Personal Access Token:
- Go to GitHub > Settings > Developer settings > Personal access tokens
- Generate a new token with the necessary permissions (usually `repo` scope)
- Copy your token for use in the scripts
## Usage
Each script follows a similar pattern:
1. Open the script you want to use and replace the configuration variables:
- `TOKEN`: Your GitHub Personal Access Token
- `OWNER`: Your GitHub username or organization name
- `REPO`: Target repository name
- Other script-specific settings
2. Run the script:
```bash
python uses/script_name.py
```
3. Check the console output for results
## Permissions
Different scripts require different token scopes:
- `repo` - For repository operations (all scripts)
- `workflow` - For GitHub Actions workflow operations
- `admin` - For repository administration tasks
## Contributing
Contributions are welcome! Please feel free to submit a pull request.
## License
Copyright © [Xi Xu](https://xi-xu.me)
Licensed under the [GPL-3.0](LICENSE) license.