This is a simple Python-based CLI application that fetches and displays the recent activity
of a specified GitHub user. This project is part of
roadmap.sh's GitHub User Activity Project,
and the goal of this program is to practice making HTTP requests and using Python modules like
requests , while also getting familiar with match cases for handling different types of events.
- Fetches recent activity of a GitHub user using the GitHub Events API.
- Displays events such as push commits, opened issues, starred repositories, and more.
- Validates that a GitHub username is provided and that the user exists.
- Option to specify a limit on the number of recent events to display.
- Error handling, including missing username, user not found and API error scenarios.
You can this CLI tool through PyPI using the following command:
pip install github-user-activity-ehdlgThen you can use the tool with the script github-activity-ehdlg.
You can also install and use the program following these steps:
-
Clone the repository:
git clone git@github.com:ehdlg/github-user-activity.git
-
Navigate to the project directory:
cd github-user-activity -
Install the dependencies: Make sure you have pip installed and then run:
pip install -r requirements.txt
To run the application, use the following command:
python __main__.py <username> [filter]Where:
- < username >: The GitHub username for which you want to fetch recent activity.
- [filter] (optional): A filter to specify the number of events to display. If not provided, the last 30 events will be shown.
-
Display recent activity of a user without a limit:
python __main__.py example_user
-
Display the first 10 recent events of a user:
python __main__.py example_user 10