GitHub Follower Analytics is a powerful, Python-based SEO-optimized tool designed to help developers, open-source maintainers, and content creators deeply understand their audience. By intelligently leveraging the GitHub API, this application fetches follower data, cleans up geographical information, and generates insightful, beautiful visualizations of your follower demographics.
- ๐ค Automated Data Fetching: Effortlessly retrieves all followers for any given GitHub username, seamlessly handling pagination.
- ๐พ Smart Local Caching:
- Followers List: Cached in
cache/followers_cache.jsonwith a 24-hour expiry to ensure fresh data daily while avoiding redundant GitHub API calls. - User Profiles: Cached in
cache/users_cache.jsonusing idempotent logic by username, ensuring each profile is only fetched once and never re-processed.
- Followers List: Cached in
- ๐ Location Normalization: Intelligently cleans and normalizes location strings (e.g., "US", "USA", "United States" โก๏ธ "United States") for accurate geographic reporting.
- ๐ Visual Analytics: Generates a beautiful pie chart showing the top geographical regions of your followers.
- โณ Rate Limit Management: Includes built-in sleep logic to handle GitHub API rate limits gracefully without crashing.
- ๐ Environment Variable Support: Securely manage your GitHub Personal Access Token using
.envfiles.
- Core Language: Python 3 ๐
- API Interaction: Requests ๐
- Data Processing: Python Standard Library (
collections.Counter) ๐งฎ - Data Visualization: Matplotlib ๐
- Environment Management: Python-Dotenv โ๏ธ
Get up and running with GitHub Follower Analytics in minutes.
-
Clone the repository:
git clone https://github.com/ishandutta2007/Github-Follower-Analytics.git cd Github-Follower-Analytics -
Set up a virtual environment (highly recommended):
Option A: Using standard
venvpython -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
Option B: Using
pyenvandpyenv-virtualenv(Alternative)pyenv virtualenv 3.11.4 github-followers-env pyenv activate github-followers-env
-
Install project dependencies:
pip install -r requirements.txt
-
Configure environment variables:
- Rename
.env.exampleto.env. - Add your GitHub Personal Access Token to the
ADMIN_TOKENfield. This is recommended to significantly increase your API rate limits.
- Rename
The project includes a modern, interactive web interface for easier accessibility.
- Navigate to the
web_uidirectory:cd web_ui - Start the FastAPI server:
python main.py
- Open your browser and go to
http://127.0.0.1:8000. - Enter any GitHub username to instantly see their follower demographics! ๐
You can still run the powerful data analysis directly from your terminal.
- Run the script:
Note: To change the target user in CLI, simply update the
python github_followers_analytics.py
GITHUB_USERNAMEvariable ingithub_followers_analytics.py.
Here is an example of the generated analytics visualizations:
We love contributions! If you have suggestions for new features, better location normalization rules, or improved visualizations, please feel free to contribute:
- ๐ด Fork the Project
- ๐ฑ Create your Feature Branch (
git checkout -b feature/AmazingFeature) - ๐พ Commit your Changes (
git commit -m 'Add some AmazingFeature') - ๐ Push to the Branch (
git push origin feature/AmazingFeature) - ๐ Open a Pull Request
This project is logically distributed under the MIT License. See the LICENSE file for more details.
Ishan Dutta - @ishandutta2007
Project Link: https://github.com/ishandutta2007/Github-Follower-Analytics
Keywords: GitHub API, Follower Analytics, Data Visualization, Python, Matplotlib, GitHub Demographics, Social Analytics, Developer Tools, Follower Tracking, Open Source Insights, SEO, Developer Dashboard.
