TripleTen CLI
A Python CLI tool for tracking TripleTen Software Engineering leaderboard, featuring real-time watch mode, rich terminal tables, authentication management, and comprehensive configuration options for students, instructors, and tutors.
TripleTen CLI
A comprehensive Python CLI tool designed to track and display the TripleTen Software Engineering leaderboard in real-time. Built for students, instructors, and tutors to monitor progress and rankings with rich terminal output, authentication management, and configurable watch modes.
Key Features
Real-Time Leaderboard Tracking
- Live Watch Mode: Continuously refresh leaderboard with configurable intervals (30-60 seconds)
- Rich Terminal Tables: Beautiful formatted tables with gold, silver, and bronze rank highlighting
- Current User Highlighting: Bold yellow highlighting for the authenticated userβs position
- Auto-formatting: Right-aligned numbers, centered ranks, and responsive column sizing
Authentication & Configuration
- Browser Cookie Authentication: Secure login using browser cookies from TripleTen platform
- Clipboard Integration: Automatic cookie reading from clipboard for seamless authentication
- Configuration Management: Persistent settings with TOML-based configuration files
- Session Persistence: Stored authentication credentials for repeated use
Multiple Time Periods
- All Time Rankings: Complete historical leaderboard data
- 30 Days View: Recent month performance tracking
- 7 Days View: Weekly progress monitoring
- Flexible Periods: Easy switching between different time ranges
Developer Experience
- Rich Terminal Output: Color-coded tables with emoji indicators and styling
- Interactive Configuration: Easy setup and customization of default settings
- Help System: Comprehensive command-line help and documentation
- Error Handling: Graceful error handling with user-friendly messages
My Role on the Project
- Full-Stack CLI Development: Designed and implemented the entire CLI application from scratch
- Authentication System: Built secure cookie-based authentication with clipboard integration
- Rich Terminal UI: Created beautiful, responsive terminal tables with color coding and styling
- Configuration Management: Implemented TOML-based configuration system with persistent storage
- Real-Time Features: Developed watch mode with configurable refresh intervals
- Testing Strategy: Established comprehensive testing with pytest and code quality tools
- Documentation: Created detailed README, contributing guidelines, and usage examples
- DevOps: Set up CI/CD with GitHub Actions, pre-commit hooks, and code quality tools
Technical Architecture
Core Technologies
- Python: Primary language with modern Python features and type hints
- Click: Command-line interface framework for robust CLI development
- Rich: Terminal formatting library for beautiful, colored output
- Requests: HTTP library for API communication with TripleTen platform
- TOML: Configuration file format for persistent settings
Development Tools
- pytest: Comprehensive testing framework with coverage reporting
- Black: Code formatter for consistent Python styling
- mypy: Static type checker for type safety
- isort: Import statement organizer
- flake8: Linter for style guide enforcement
- pre-commit: Git hook framework for code quality
Project Structure
- Modular Design: Clean separation of concerns with dedicated modules
- Configuration Management: Centralized settings with TOML configuration files
- Error Handling: Comprehensive error handling with user-friendly messages
- Testing: Full test coverage with unit and integration tests
CLI Commands
Leaderboard Display
# Default leaderboard (all time)
tripleten
# Specific time periods
tripleten leaderboard --period 30_days
tripleten leaderboard --period 7_days
# Watch mode with custom interval
tripleten leaderboard --watch --interval 60
tripleten leaderboard -w --interval 30
Authentication
# Auto-read cookies from clipboard
tripleten login
# Manual cookie input
tripleten login --cookies "your_cookie_string_here"
Configuration
# Show current settings
tripleten config --show
# Set default values
tripleten config --set default_interval 45
tripleten config --set default_period 7_days
Sample Output
Rich Table Display
π Leaderboard
ββββββββββ³βββββββββββββββββββββββ³βββββββββββββ³βββββββββββββ³βββββββββββ
β Rank β Name β XP β Completed β Streak β
β‘βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©
β 1 β Oluwasetemi Ojo β 43 β 0 β 0 β
β 2 β Marina Viriyalova β 19 β 0 β 0 β
β 3 β Luiz Araujo β 10 β 0 β 0 β
ββββββββββ΄βββββββββββββββββββββββ΄βββββββββββββ΄βββββββββββββ΄βββββββββββ
Configuration Display
Current Configuration:
Location: ~/.config/tripleten-cli/config.toml
ββββββββββββββββββββ³ββββββββββββββββββββββββββββββββββββββββββββββ
β Setting β Value β
β‘βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©
β default_period β all_time β
β default_interval β 30 β
β session_cookie β ****def456 β
β user_id β alice123 β
ββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββ
Installation & Usage
Installation
# Install from PyPI
pip install tripleten-cli
# Or install from source
git clone https://github.com/Oluwasetemi/tripleten_cli.git
cd tripleten_cli
pip install -e .
Quick Start
# Login with your TripleTen credentials
tripleten login
# View leaderboard
tripleten
# Watch mode for real-time updates
tripleten -w --interval 30
Development Setup
Environment Setup
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install development dependencies
pip install -e ".[dev]"
# Install pre-commit hooks
pre-commit install
Code Quality
# Format code
black src/ tests/
# Sort imports
isort src/ tests/
# Lint code
flake8 src/ tests/
# Type checking
mypy src/
# Run tests
pytest
Motivation & Impact
This project was created to solve a real need in the TripleTen educational community. As a tutor and instructor, I needed a way to quickly check student progress and rankings without constantly refreshing the web interface. The CLI tool provides:
- Efficiency: Quick access to leaderboard data without browser navigation
- Real-time Monitoring: Watch mode for continuous progress tracking
- Better UX: Rich terminal output with clear visual hierarchy
- Automation: Persistent authentication and configuration for seamless use
Live Demo & Resources
- Source Code: GitHub Repository
- PyPI Package: Available for easy installation
- Documentation: Comprehensive README and contributing guidelines
- Demo Script: Interactive demo showcasing all features
Future Enhancements
- Export Features: CSV/JSON export of leaderboard data
- Notifications: Desktop notifications for rank changes
- Analytics: Progress tracking and trend analysis
- Multi-platform: Enhanced support for different operating systems
- API Integration: Direct API access for faster data retrieval
The TripleTen CLI demonstrates modern Python CLI development practices with a focus on user experience, code quality, and maintainability.