A lightweight, command-line interface (CLI) tool written in Python that fetches and summarizes a user's recent GitHub activity using the GitHub REST API.
The tool queries GitHub's public data to provide three key insights:
✅ Push Commits: Counts the total number of commits pushed by the user (excluding commits to forked repositories).
🔴 Issues Opened: Displays whether the user has opened any issues, showing either "No issues opened" or the specific count.
⭐️ Starred Repositories: Lists all the repositories the user has starred.
Before running the script, ensure you have Python 3 installed on your system. This project uses the built-in urllib and json libraries, so no external dependencies (like requests) are required.
- Clone the Repository
git clone https://github.com/patra-rahul/gitman.git
cd gitman- (Optional) Configure a GitHub Token:
To avoid GitHub API rate limiting, you can set up a personal access token. Once you get the token, create a
.envfile and write:
GITHUB_TOKEN = Bearer github_{your username}_{token}Run the script from your terminal using the following command structure:
python3 gitman.py github-activity "username"- The script communicates directly with the GitHub REST API (https://api.github.com).
- It parses the
/users/{username}/eventsendpoint to calculate recent push events and opened issues. - It fetches the
/users/{username}/starredendpoint to retrieve the list of starred repositories.
This was a very short project to learn about how to use REST APIs. It was a good learning experience for me. Thank you for checking it out! ❤️
Project link: https://roadmap.sh/projects/github-user-activity