A command-line tool to fetch and display recent activity of a GitHub user.
- 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)
- Clone the repository:
git clone https://github.com/yourusername/github-user-activity.git
cd github-user-activity
- Install the package:
pip install .
- For development (includes pytest):
pip install ".[dev]"
# 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
$ 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
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:
- Install Redis on your system
- Make sure Redis server is running locally on the default port (6379)
- Install the Redis Python client:
pip install redis
- Python 3.6+
- Redis (optional) - for caching GitHub API responses
# 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]"
This project uses modern Python packaging with pyproject.toml
for configuration, following PEP 621 standards. No setup.py
file is needed.
# Run all tests
pytest
# Run with coverage report
pytest --cov=github_activity
MIT