The GitHub Unfollow Script is a magical Python tool designed to help you manage your GitHub following list effectively. This script automatically unfollows users who are not following you back, ensuring your network remains relevant and streamlined.
Perfect for maintaining a streamlined and relevant network on GitHub! This script is for developers and GitHub users who want to keep their following list clean and relevant, automating the tedious task of unfollowing inactive or non-reciprocal followers.
- GitHub API Integration: The script interacts with GitHub using the official GitHub API.
- Authentication via Personal Access Token: Securely authenticate using a personal access token, which you provide in a
.env
file. - Automated Unfollowing: The script fetches your list of followers and the users you are following, identifies those who do not follow you back, and automatically unfollows them.
- Comprehensive Reporting: Generates a detailed report of the operation, including the current followers, current following, and a list of users who were unfollowed. The report is saved in the
logs
directory with a timestamp, and the result is also printed in the console.
- Automatic Unfollowing: Unfollows users who don't follow you back.
- Detailed Reporting: Generates a comprehensive report with current followers, following, and the list of unfollowed users.
- Easy Setup: Simple configuration with a
.env
file. - Cross-Platform: Works on Unix-like systems and Windows.
-
Clone the repository:
git clone https://github.com/your-username/github-unfollow.git cd github-unfollow
-
Set up a virtual environment:
- On Unix-like systems:
source setup_venv.sh
- On Windows:
.\setup_venv.ps1
- On Unix-like systems:
-
Create a
.env
file in the root directory of the project with your GitHub credentials. You can use the provided.env.example
template and rename it to.env
:cp .env.example .env
Then edit the
.env
file:GITHUB_USERNAME=your_username GITHUB_TOKEN=your_personal_access_token
personal token you can get here:
GitHub > Settings > Developer settings > Personal access tokens
https://github.com/settings/tokens
To create a GitHub personal access token:
- Go to GitHub Settings.
- Click on Developer settings in the left sidebar.
- Under Personal access tokens, click on Tokens (classic).
- Click Generate new token.
- Give your token a descriptive name.
- In the Permissions section, set the following permissions:
- Followers:
Access: Read and write
- Followers:
- Click Generate token.
- Copy the token and add it to your
.env
file asGITHUB_TOKEN
.
Run the script:
python github_unfollow.py
After running the script, a report will be saved in the logs
directory with the current date and time in the filename.
Example content of a report file:
2024-06-30 14:45
Current followers: 51
Current following: 54Unfollowed 3 users:
nickname1
nickname2
nickname3
This script helps you keep your following list up to date by unfollowing users who are not following you back.
This project is licensed under the MIT License. See the LICENSE file for details.
SEO Keywords: GitHub automation, manage GitHub followers, unfollow script, Python GitHub API, automate GitHub, GitHub following management, GitHub unfollow tool, GitHub user management, streamline GitHub network, GitHub follower report
Contact: For any questions or suggestions, feel free to open an issue or contact me at e-nicko@ya.ru.