A Tkinter-based test client for the /api/mobile/config/game/stats/epa-opr-history endpoint.
This script provides an interactive UI to:
- Login to the mobile API using credentials and team number
- Select an event by ID, code, or year-prefixed code
- Fetch EPA and OPR data for teams at that event
- View results in a table format with per-match details
- Tabbed Interface: 4 tabs for Login → Event → Fetch → Results workflow
- Team Data Table: Shows OPR, DPR, CCWM ratings for each team
- Match Details: Double-click a team to view per-match EPA breakdown
- Configurable Limits: Set max matches per team (default 200, max 500)
- Selective Team Fetching: Fetch all teams or specific team numbers
- Real-time Status: Live feedback on login, fetch, and errors
pip install requestspython test_epa_opr_history.py- API Base URL: Leave as
http://localhost:5000/api/mobileor update if running remotely - Username: Enter your scouting team username
- Password: Enter the password for that user
- Team Number: Enter your scouting team number (e.g.,
5454) - Click Login button
If successful, you'll see "✓ Logged in as..." and move to Tab 2.
- Event ID: Enter one of:
- Numeric database ID:
123 - Year-prefixed code:
2026OKTU - Raw code:
OKTU(auto-resolved to current season)
- Numeric database ID:
- Team Numbers (optional): Leave blank for all teams, or enter comma-separated list:
254,1678,971
- Max Matches per Team: Default is 200 (adjust if needed)
- Click Fetch EPA/OPR History to request data
- Watch the progress bar and status updates
- If successful, automatically moves to Tab 4
- Table View: Shows team summaries with OPR/DPR/CCWM ratings
- Double-click any team to see:
- Per-match breakdown with EPA estimates
- Auto, Teleop, and Endgame point splits
- Match timing and alliance assignment
- Raw JSON data
| Column | Source | Description |
|---|---|---|
| Team # | API | Team number |
| Team Name | API | Team name from database |
| OPR | TBA | Offensive Power Rating |
| DPR | TBA | Defensive Power Rating |
| CCWM | TBA | Contribution to Winning Margin |
| # Matches | Statbotics | Number of matches with EPA data |
- OPR Data: Event-level statistics from The Blue Alliance
- Per-Match EPA: Historical match-by-match estimates from Statbotics
- Match number and competition level (qm, ef, qf, sf, f)
- Alliance (red/blue)
- EPA breakdown: Total, Auto, Teleop, Endgame
POST /api/mobile/config/game/stats/epa-opr-history
{
"event_id": "2026OKTU",
"team_numbers": [254, 1678],
"limit": 200
}{
"success": true,
"event_code": "OKTU",
"tba_event_key": "2026oktu",
"teams": [
{
"team_number": 254,
"team_name": "The Cheesy Poofs",
"match_epa_history": [...],
"opr_data": {
"opr": 45.3,
"dpr": 15.2,
"ccwm": 8.1
}
}
]
}The script handles several error scenarios:
- Connection errors: Shows error message if server is unreachable
- Authentication errors: Displays login failure reason (invalid credentials, inactive account)
- Event not found: Returns when event doesn't exist or isn't accessible
- API errors: Shows raw error message from server
- Verify the server is running on the configured port
- Check API base URL is correct (default:
http://localhost:5000/api/mobile)
- Verify username, password, and team number are correct
- Check that the user account is active
- Try using numeric event ID format
- Try full year-prefixed code:
2026OKTUinstead ofOKTU - Check that event exists in database
- Verify teams have participated in the selected event
- Check that your scouting team has access to those teams
- Try fetching all teams (leave team numbers blank)
- EPA Data: Statbotics API (per-match historical estimates)
- OPR Data: The Blue Alliance API (event-level rankings)
- EPA/OPR data availability depends on whether the external APIs have processed the event
- Historical data may take time to appear after matches are played
- The script caches token for the session; you can login as different users by entering new credentials
Same as OBSIDIAN Scout project