NHL Roster Scrabble Score Analyzer - Calculate Scrabble scores for NHL player names
Project description
NHL Scrabble Score Analyzer
A Python application that fetches current NHL roster data and calculates "Scrabble scores" for player names based on standard Scrabble letter values. Generate comprehensive reports showing team, division, and conference standings complete with playoff brackets!
Features
- ๐ Live NHL Data - Fetches current roster data from the official NHL API
- ๐ Web Interface - FastAPI-powered server with interactive dashboard
- ๐ Comprehensive Reports - Conference/division standings, playoff brackets, team scores, statistics
- ๐ Progress Tracking - Real-time progress bars for long operations
- ๐ฏ Flexible Output - Text, JSON, or HTML format
- ๐จ Colorized Logging - Color-coded log levels with TTY detection and NO_COLOR support
- ๐ Internationalization - 12 locales supported (EN, FR, SV, RU, FI, CS, DE, IT, SK, LV) with gettext translations
- ๐งช Comprehensive Testing - >90% code coverage with 170+ unit/integration tests
- Playwright-based E2E testing (40+ browser tests)
- Visual regression testing across browsers (Chromium, Firefox, WebKit)
- Performance and load testing with benchmarks
- WCAG 2.1 AA accessibility compliance testing
- Automated cross-browser QA in CI/CD
- โก Lightning Fast - UV support for 10-100x faster installation
- ๐ Production-Ready - Security headers, CORS, caching, deployment guides
Quality Assurance
This project includes comprehensive automated QA testing beyond unit/integration tests:
- Framework: Playwright with Page Object Model architecture
- Test Coverage: 40+ end-to-end tests across 4 categories
- Browser Support: Automated testing on Chromium, Firefox, and WebKit
- Test Types:
- Functional - User workflows, interactions, navigation (15 tests)
- Visual Regression - Screenshot comparison across browsers (10 tests)
- Performance - Page load times, API response benchmarks (8 tests)
- Accessibility - WCAG 2.1 AA compliance validation (7 tests)
- Documentation: See qa/README.md for detailed QA framework documentation
- CI Integration: Automated runs on PRs, commits to main, and nightly schedule (2 AM UTC)
Run QA tests locally:
make qa-install # Install QA dependencies (Playwright, browsers)
make qa-test # Run all QA tests (~5-7 minutes)
make qa-functional # Run functional tests only
make qa-visual # Run visual regression tests
make qa-performance # Run performance tests
make qa-accessibility # Run accessibility tests
CI/CD Workflow: .github/workflows/qa-automation.yml
- Cross-browser matrix testing (parallel execution)
- Artifact uploads (reports, screenshots, visual diffs, performance metrics)
- PR comments with test summaries and failure details
- Manual workflow dispatch with test suite and browser selection
Screenshots
Web Interface
The NHL Scrabble web interface provides a modern, interactive experience:
- Main Dashboard - Clean, responsive design with one-click analysis
- Analysis Results - Sortable tables, standings, playoff brackets, statistics
- Interactive Features - Chart.js visualizations, export (JSON/CSV/PDF), table sorting
- API Documentation - Swagger UI (
/docs) and ReDoc (/redoc)
CLI Output
Text Output (Default)
๐ NHL SCRABBLE SCORE ANALYSIS ๐
TOP 20 PLAYERS BY SCRABBLE SCORE
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
1. Alexander Ovechkin (WSH) 45 points
2. Zdeno Chara (BOS) 42 points
...
JSON Output - Machine-readable format for integrations
HTML Output - Fully styled browser report with embedded CSS
Installation
From Source
# Clone the repository
git clone https://github.com/bdperkin/nhl-scrabble.git
cd nhl-scrabble
# Install in development mode
make init
# Or manually with pip
pip install -e ".[dev]"
Using Docker
Run the analyzer using Docker without installing Python:
# Pull from GitHub Container Registry
docker pull ghcr.io/bdperkin/nhl-scrabble:latest
# Run analysis
docker run --rm ghcr.io/bdperkin/nhl-scrabble:latest analyze
# Save output to a file
docker run --rm -v $(pwd):/output \
ghcr.io/bdperkin/nhl-scrabble:latest \
analyze --output /output/report.txt
# Use with environment variables
docker run --rm \
-e NHL_SCRABBLE_VERBOSE=true \
-e NHL_SCRABBLE_TOP_PLAYERS=50 \
ghcr.io/bdperkin/nhl-scrabble:latest analyze
Available tags:
latest- Latest stable release from main branch2.1.0- Specific version (replace with desired version)2.1,2- Major.minor and major version tags
Supported platforms: linux/amd64, linux/arm64
Requirements
- Supported: Python 3.12, 3.13, 3.14
- Experimental: Python 3.15-dev (CI testing only, may have issues)
- Dependencies:
requests,click,pydantic,python-dotenv,rich,fastapi,uvicorn,jinja2 - Note: UV acceleration is automatic when using tox (via tox-uv plugin)
Quick Start
Run the analysis with default settings:
nhl-scrabble analyze
Or use the Python module directly:
python -m nhl_scrabble analyze
For detailed usage, see the CLI Tutorial.
Usage
CLI Commands
# Basic analysis
nhl-scrabble analyze
# Verbose output with colorized logging
nhl-scrabble analyze -v
# JSON output to file
nhl-scrabble analyze -f json -o report.json
# HTML output
nhl-scrabble analyze -f html -o report.html
# Customize display
nhl-scrabble analyze --top-players 50 --top-team-players 10
Web Server
# Start web server (default port 8000)
nhl-scrabble serve
# Custom host and port with auto-reload
nhl-scrabble serve --host 0.0.0.0 --port 5000 --reload
Visit http://localhost:8000/docs for interactive API documentation.
Interactive Dashboard
# Launch terminal dashboard
nhl-scrabble dashboard
# Filter by division/conference
nhl-scrabble dashboard --divisions Atlantic --conferences Eastern
# Static snapshot (no live updates)
nhl-scrabble dashboard --static
Complete Usage Documentation:
- CLI Tutorial - Step-by-step CLI guide
- CLI Reference - All commands and options
- Configuration Guide - Environment variables and settings
How It Works
The analyzer uses standard English Scrabble letter point values (A=1, Z=10, etc.) to score player names. It fetches live NHL data, calculates scores, aggregates by team/division/conference, and generates comprehensive reports with playoff brackets.
Learn More:
- Why Scrabble Scoring? - The concept explained
- How Scrabble Scoring Works - Detailed scoring logic
- Architecture Overview - System design
- NHL API Strategy - API integration approach
Development
Quick Start
# Clone and setup
git clone https://github.com/bdperkin/nhl-scrabble.git
cd nhl-scrabble
make init
source .venv/bin/activate
# View all available commands (57 targets)
make help
Testing
# Run all tests
make test
# Run with coverage
make test-cov
# Multi-version testing with tox
make tox # Test Python 3.12, 3.13, 3.14
make tox-parallel # Faster parallel execution
Code Quality
# Format and lint
make ruff-format
make ruff-check
# Type checking
make mypy
# Run all quality checks
make quality
# Full validation (format + quality + tests)
make check
Pre-commit Hooks
The project uses 67 comprehensive pre-commit hooks for automatic code quality validation:
# Install hooks (one-time)
pre-commit install
# Run all hooks manually
pre-commit run --all-files
# Update hook versions
pre-commit autoupdate
Complete Development Documentation:
- CONTRIBUTING.md - Development guidelines and workflow
- Makefile Reference - All 57 Makefile targets
- Testing Guide - Test execution and configuration
- UV Package Manager - 10-100x faster installation
Project Structure
nhl-scrabble/
โโโ src/nhl_scrabble/ # Main package
โ โโโ api/ # NHL API client
โ โโโ scoring/ # Scrabble scoring logic
โ โโโ models/ # Data models (Pydantic)
โ โโโ processors/ # Business logic
โ โโโ reports/ # Report generators
โ โโโ cli.py # CLI interface (Click)
โ โโโ config.py # Configuration management
โโโ tests/ # Test suite (170+ tests)
โ โโโ unit/ # Unit tests
โ โโโ integration/ # Integration tests
โโโ docs/ # Documentation (Diรกtaxis framework)
โโโ pyproject.toml # Project & UV configuration
โโโ uv.lock # Dependency lock file (1,957 lines)
See Architecture Overview for detailed system design.
Documentation
Online Documentation: https://bdperkin.github.io/nhl-scrabble/
Documentation follows the Diรกtaxis framework:
- Tutorials - Step-by-step lessons for beginners
- How-to Guides - Practical solutions to specific tasks
- Reference - Technical specifications
- Explanation - Design philosophy and concepts
Community:
- CONTRIBUTING.md - Development guidelines
- SECURITY.md - Security policy
- SUPPORT.md - Getting help
- CHANGELOG.md - Version history
- CLAUDE.md - Project overview for Claude Code
Contributing
Contributions are welcome! See CONTRIBUTING.md for detailed guidelines.
Quick Overview:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes with tests
- Run quality checks (
make check) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Security
This project takes security seriously with comprehensive automated scanning:
- Dependabot - Automated dependency updates and security alerts
- pip-audit - CI vulnerability scanning
- CodeQL - Weekly security scans
- Pre-commit hooks - 67 comprehensive quality and security checks
Reporting Vulnerabilities: See SECURITY.md for responsible disclosure guidelines. Do not report security vulnerabilities through public GitHub issues.
Support
- Documentation: https://bdperkin.github.io/nhl-scrabble/
- Issues: Report bugs or request features via GitHub Issues
- Discussions: Ask questions in GitHub Discussions
See SUPPORT.md for detailed support information.
License
This project is licensed under the MIT License - see the LICENSE file for details.
All runtime dependencies use permissive licenses compatible with MIT (Apache, BSD, ISC, etc.). See LICENSES.md for the complete list.
To verify license compliance:
tox -e licenses
Project Statistics
- Test Coverage: 49.93% overall, >90% on core modules
- Tests: 170+ tests (100% passing)
- Modules: 15 core modules
- Makefile Targets: 57 documented targets
- Pre-commit Hooks: 67 comprehensive quality checks
- CI/CD: GitHub Actions on Python 3.12, 3.13, 3.14 (required), 3.15-dev (experimental)
See Project Stats for complete metrics.
Acknowledgments
- NHL API for providing roster data
- Scrabble is a trademark of Hasbro, Inc.
Changelog
See CHANGELOG.md for version history.
Made with โค๏ธ for hockey and word games
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nhl_scrabble-0.0.16.tar.gz.
File metadata
- Download URL: nhl_scrabble-0.0.16.tar.gz
- Upload date:
- Size: 11.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c18ba83b68b5dc10790b3e1e85da62a563f368bd322ed57ac5af6db90bbee123
|
|
| MD5 |
340cb9cac5dca79ce95d4759af299c4d
|
|
| BLAKE2b-256 |
ea709b333a453c6d7aee68de2a2480e392998de6452d270a870c026d848874ac
|
Provenance
The following attestation bundles were made for nhl_scrabble-0.0.16.tar.gz:
Publisher:
publish.yml on bdperkin/nhl-scrabble
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nhl_scrabble-0.0.16.tar.gz -
Subject digest:
c18ba83b68b5dc10790b3e1e85da62a563f368bd322ed57ac5af6db90bbee123 - Sigstore transparency entry: 1456489538
- Sigstore integration time:
-
Permalink:
bdperkin/nhl-scrabble@570150238d9ebba2fd230c685465c07888896748 -
Branch / Tag:
refs/tags/v0.0.16 - Owner: https://github.com/bdperkin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@570150238d9ebba2fd230c685465c07888896748 -
Trigger Event:
push
-
Statement type:
File details
Details for the file nhl_scrabble-0.0.16-py3-none-any.whl.
File metadata
- Download URL: nhl_scrabble-0.0.16-py3-none-any.whl
- Upload date:
- Size: 298.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a357609507d592ece70177dbdec7458bfefdceef938668e12b52fec9aa42d76
|
|
| MD5 |
40d25abd25cf96868d9ec03b63625c71
|
|
| BLAKE2b-256 |
f46054cfcc201cef1555ec7bf79f9123f9e62c366aceb9a9becb0acbe6e68869
|
Provenance
The following attestation bundles were made for nhl_scrabble-0.0.16-py3-none-any.whl:
Publisher:
publish.yml on bdperkin/nhl-scrabble
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nhl_scrabble-0.0.16-py3-none-any.whl -
Subject digest:
8a357609507d592ece70177dbdec7458bfefdceef938668e12b52fec9aa42d76 - Sigstore transparency entry: 1456489623
- Sigstore integration time:
-
Permalink:
bdperkin/nhl-scrabble@570150238d9ebba2fd230c685465c07888896748 -
Branch / Tag:
refs/tags/v0.0.16 - Owner: https://github.com/bdperkin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@570150238d9ebba2fd230c685465c07888896748 -
Trigger Event:
push
-
Statement type: