A simple script to analyze your GitHub social graph: find out who you follow that doesn't follow you back, and who follows you that you don't follow back.
- Analyzes your GitHub "followers" and "following" relationships
- Identifies:
- People you follow who do not follow you back ("non-followers")
- People who follow you but you do not follow back ("fans")
- Handles large accounts (uses proper API pagination)
- Clear command-line output
- Graceful error handling for authentication and API rate limits
- Optionally exports results to a file (TXT or CSV)
This script fetches your followers and users you are following via the GitHub API, compares the two sets, and prints out:
- A list of users you follow who don't follow you back
- A list of users who follow you, but you don't follow back
You can also choose to export the results to a TXT or CSV file.
- Python 3.x
requests
module (pip install requests
)- GitHub Personal Access Token (with
read:user
permissions)
-
Clone this repository:
git clone https://github.com/hrosicka/github-follower-analyzer.git cd github-follower-analyzer
-
Install dependencies:
pip install requests
-
Set up your credentials:
- Open
main.py
- Set your GitHub username:
GITHUB_USERNAME = 'your-github-username'
- Set your GitHub Personal Access Token:
GITHUB_TOKEN = 'your-personal-access-token'
- Tip: For better security, use an environment variable instead of hardcoding your token.
Uncomment and use:
Then set
# GITHUB_TOKEN = os.environ.get('GITHUB_PAT')
GITHUB_PAT
in your environment.
- Open
-
(Optional) Configure environment variable:
- On Linux/macOS:
export GITHUB_PAT='your-personal-access-token'
- On Windows (Command Prompt):
set GITHUB_PAT=your-personal-access-token
- On Windows (PowerShell):
$env:GITHUB_PAT='your-personal-access-token'
- On Linux/macOS:
Run the script:
python main.py
You will see output like:
--- Comparison Results ---
Total Followers: 42
Total Following: 30
Users you follow who DO NOT follow you back (3):
- user123
- user456
- user789
Users who FOLLOW YOU but you DO NOT follow back (1):
- fanuser
--- Done ---
You can now export the results to a TXT or CSV file:
-
Export to TXT:
python main.py --output results.txt
-
Export to CSV:
python main.py --output results.csv --format csv
Results will always be printed to the console by default. Providing arguments for exporting is optional; if omitted, the script behaves as before.
- The script handles pagination to support accounts with many followers/followings.
- Authentication and rate limit errors are clearly reported.
- Never commit your Personal Access Token to a public repository!
MIT License