The capstone
The advanced techniques only pay off if they run reliably at event pace. This lesson designs the end-to-end pipeline: scouting in, public APIs joined, validated metrics out, rebuildable in one command between match cycles.
Architecture
Keep stages decoupled so any one can be debugged or replaced:
- Ingest: scanned QRScout rows append to a
rawsource (a Google Sheet or CSV). Append-only; never edit in place. - Enrich: a script pulls TBA (
event_matches,event_oprs,event_rankings) and Statbotics (get_team_event) for the event, keyed by team number. - Compute: join scouting averages with OPR/EPA, compute custom metrics (per-level coral rates, endgame reliability, defense rating), and validation flags.
- Output: a
ranktable and per-match prep sheets, regenerated on demand.
A concrete skeleton
import pandas as pd, tbapy, statbotics
EVENT = '2025cc'
tba = tbapy.TBA('YOUR_TBA_KEY')
sb = statbotics.Statbotics()
# 1. Ingest scouting (exported from your QRScout sheet)
raw = pd.read_csv('scouting_raw.csv')
agg = raw.groupby('teamNumber').mean(numeric_only=True)
# 2/3. Enrich with public analytics
oprs = tba.event_oprs(EVENT)['oprs'] # {'frc254': 78.3, ...}
agg['opr'] = [oprs.get(f'frc{t}') for t in agg.index]
agg['epa'] = [ sb.get_team_event(int(t), EVENT).get('epa')
for t in agg.index ] # EPA at this event
# 4. Validation flags
agg['low_sample'] = raw.groupby('teamNumber').size() < 3
agg['scout_vs_opr_gap'] = (agg['ptsContributed'] - agg['opr']).abs()
agg.sort_values('ptsContributed', ascending=False).to_csv('rank.csv')
Use the Statbotics fields parameter and TBA simple/keys options to keep responses small and fast, and send the TBA ETag back as If-None-Match so repeated refreshes return a cheap 304 Not Modified.
Make it reliable at event pace
- One command, idempotent. Running the pipeline twice gives the same result; you can rebuild anytime without manual cleanup.
- Fail loud on validation. If
low_sampleorscout_vs_opr_gapis high for a top team, surface it so a super-scout is dispatched, instead of silently ranking on thin data. - Cache API calls. Store TBA/Statbotics responses locally per refresh so a flaky venue connection or rate limit does not block your rebuild; QR scouting already works offline, so your analysis should degrade gracefully too.
- Keep a manual fallback. If the script breaks mid-event, the
aggspreadsheet alone (from the Worked Examples module) still produces a usable ranking. Never let the fancy pipeline be a single point of failure.
What you have built
Put together with the earlier modules, this is a complete, defensible scouting operation: offline-first collection, measured scout accuracy, validated custom metrics, public-analytics cross-checks, predictive what-ifs, explicit defense evaluation, and a one-command rebuild that feeds picklists and pre-match briefs. That is the difference between a team that has data and a team that wins with it.
Key takeaways
- Decouple the pipeline into ingest (append-only) -> enrich (TBA + Statbotics) -> compute (custom metrics + validation) -> output (rank + briefs).
- Make rebuilds idempotent and one-command, cache API calls, and fail loud on low-sample or scouting-vs-OPR gaps to trigger super-scouts.
- Always keep a manual spreadsheet fallback so the automated pipeline is never a single point of failure at an event.
Go deeper
Lesson quiz
RequiredAnswer all 5 questions correctly to complete this lesson.
01.Which sequence describes the decoupled stages of an automated FRC scouting analysis pipeline?
02.How should the ingest stage treat the raw scouting source?
03.When low_sample or a large scout-vs-OPR gap appears for a top team, what should the pipeline do?
04.Why should TBA and Statbotics API responses be cached locally?
05.Why keep a manual spreadsheet fallback for the pipeline?
Answer every question to submit.
All 32 lessons in Scouting & Strategy
- Not started:Project 1: Configure a QRScout Form for REEFSCAPE
- Not started:Project 2: Compute OPR by Hand, Then in a Spreadsheet
- Not started:Project 3: Pull Live Data with the TBA and Statbotics APIs
- Not started:Project 4: Build an EPA-Component Robot Ranking Sheet
- Not started:Project 5: Assemble a One-Page Pre-Match Prep Sheet