Skip to main content

CLI tool to fetch and display GitHub user activity

Project description

GitHub User Activity CLI

A command-line tool to fetch and display recent activity of a GitHub user.

Features

  • Fetch recent activity of any GitHub user
  • Display activity in a human-readable format
  • Handle errors gracefully
  • Limit the number of events displayed
  • Redis-based caching (optional)

Installation

From Source

  1. Clone the repository:
git clone https://github.com/yourusername/github-user-activity.git
cd github-user-activity
  1. Install the package:
pip install .
  1. For development (includes pytest):
pip install ".[dev]"

Usage

# Display recent activity for a GitHub user
github-activity <username>

# Display only the 5 most recent events
github-activity <username> --limit 5

# Show help
github-activity --help

# Show version
github-activity --version

Example

$ github-activity octocat
Recent activity for GitHub user 'octocat':

- Pushed 3 commit(s) to octocat/Hello-World
- Opened issue #123 in octocat/Hello-World
- Created branch 'feature/new-feature' in octocat/Hello-World
- Starred microsoft/vscode

Caching

This application includes Redis-based caching for GitHub API responses. This feature was implemented primarily for learning purposes and to demonstrate integrating external services.

Note: Redis is completely optional. The application works perfectly fine without Redis installed - it will simply make a new API request each time instead of using cached data. The design demonstrates how to implement optional dependencies in a way that gracefully degrades when they're not available.

If you want to use the caching feature:

  1. Install Redis on your system
  2. Make sure Redis server is running locally on the default port (6379)
  3. Install the Redis Python client: pip install redis

Development

Requirements

  • Python 3.6+
  • Redis (optional) - for caching GitHub API responses

Setup Development Environment

# Clone the repository
git clone https://github.com/yourusername/github-user-activity.git
cd github-user-activity

# Install in development mode with testing dependencies
pip install ".[dev]"

Project Structure

This project uses modern Python packaging with pyproject.toml for configuration, following PEP 621 standards. No setup.py file is needed.

Running Tests

# Run all tests
pytest

# Run with coverage report
pytest --cov=github_activity

License

MIT

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-0.2.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

github_user_activity-0.2.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file github_user_activity-0.2.0.tar.gz.

File metadata

  • Download URL: github_user_activity-0.2.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for github_user_activity-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4efd84b2401fffc94e23a69521283f52a87c0cbe68ce51ce201102e41e99e8a8
MD5 5167e0fa02a866641feadf9c8d89bc61
BLAKE2b-256 4395ee88ecbfb1966de528b46942aa382d9e2bce9ac4c7c80f6dae6d3672f8c9

See more details on using hashes here.

File details

Details for the file github_user_activity-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for github_user_activity-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 de8ec8059f6511bbbe5e40ec0cae38817ad3facd4e253e500a48dadc0ca15e22
MD5 d3e9619ce23ee622fbdda3f0e5e17054
BLAKE2b-256 1dc966530fdf7bcb29e53958daf5001946e05d75eaea9320b2bd5227b9c3f6bb

See more details on using hashes here.

Supported by

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