Made as part of a preseason scouting project for FRC.
This repository contains two versions of the script:
- Old version: outputs results to the terminal
- New version: saves results to an Excel spreadsheet
This project collects event-level EPA data for FRC teams and organizes it for easy analysis.
This script automatically:
- Finds the events a team attended in a given year
- Filters out offseason / invitational events
- Identifies the 1st event, 2nd event, and Worlds (if applicable)
- Pulls EPA data from Statbotics
- Rounds EPA to the nearest tenth
- Writes or updates results in an Excel file (newer version)
Used to determine which events a team attended.
- Filters out offseason events using:
event_type == 99
Used to retrieve EPA for a specific team at a specific event.
You need a The Blue Alliance API key.
-
Create an account at
https://www.thebluealliance.com -
Generate an API key from your account page
-
Paste the key into the script:
TBA_AUTH_KEY = "PASTE_YOUR_TBA_API_KEY_HERE"
OR enter it when prompted during runtime.
WARNING!!!!!!!:
Do not upload this file to GitHub with your API key in it.
From the folder containing the script:
python team_first_second_worlds_epa_to_excel.pyYou will be prompted for:
TBA_AUTH_KEY:
Team number (or q):
Year (e.g. 2024):
The script will then:
- Fetch events from TBA
- Calculate EPAs using Statbotics
- Print results to the console
- Save or update the Excel file
You can run the script multiple times for different teams and years.
The Excel file will be updated, not duplicated.
The script creates or updates an Excel file:
team_epa_2024.xlsx
Each row represents one team for one year, including:
- First event info + EPA
- Second event info + EPA
- Worlds info + EPA (if applicable)
- Python 3.9 or newer recommended
This script depends on three external libraries:
- statbotics – retrieves EPA data
- requests – calls The Blue Alliance API
- openpyxl – creates and updates Excel files
Install everything at once:
pip install statbotics requests openpyxlIf you have multiple Python versions:
python -m pip install statbotics requests openpyxl- Batch process a list of teams
- Add EPA change columns (Event 2 − Event 1)
- Auto-sort Excel by team number
- Add conditional formatting or charts
Personal / educational use.
Please respect API rate limits for The Blue Alliance and Statbotics.