A simple command line interface (CLI) tool built with Python to fetch and display the recent activity of a GitHub user. This project helped me practice working with APIs, handling JSON data, and building a CLI application.
This CLI fetches the public events of a specified GitHub user using the GitHub API and formats them for display in the terminal. It handles common events such as push events, issues, pull requests, stars, and more.
Features include:
- Accepting a GitHub username as a command-line argument.
- Fetching the user's recent activity from the GitHub API.
- Displaying formatted event messages, e.g.,
- Pushed 3 commits to kamranahmedse/developer-roadmap - Graceful error handling for invalid usernames, network issues, and API errors.
-
Clone the Repository:
git clone https://github.com/CodeSaadUmair/GitHubUserActivityCLI.git
-
Change Directory:
cd GitHubUserActivityCLI -
Set Up a Virtual Environment (Optional but Recommended):
python3 -m venv venv venv\Scripts\activate
-
Install Dependencies: This project uses the requests library. Install it via pip:
pip install requests
Run the CLI by passing a GitHub username as an argument:
python github_activity.py <username>For example:
python github_activity.py octocatThis project was inspired by the roadmap.sh's GitHub User Activity project.