Skip to main content

CLI application that fetches an ddisplays the recent activity of a specified GitHub user

Project description

GitHub User Activity CLI

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.

Features

  • 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.

Installation

  1. Clone the repository:

    git clone git@github.com:ehdlg/github-user-activity.git
    
  2. Navigate to the project directory:

    cd github-user-activity
    
  3. Install the dependencies: Make sure you have pip installed and then run:

    pip install -r requirements.txt
    

Usage

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.

Examples

  • 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
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

github_user_activity_ehdlg-1.0.0.tar.gz (3.1 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page