factcircuit
FactCircuit: an auditable claim-and-evidence verification loop with immutable provenance, staged checks, bounded retrieval, and reproducible evaluation.
Batch Processing ETL on NBA's Last Two Minute (L2M) Report
Translation pending
DataHTML · PythonGitHub @YusufAlam1OnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
Loading the full README. The saved excerpt is shown below.
This project analyzes the NBA Last Two Minute (L2M) Report through an interactive Flask dashboard.
The L2M report is the league's transparency initiative for officiating decisions in the final two minutes of close games (fourth quarter and overtime). This app turns that raw report data into a decision-quality dashboard focused on trends, call types, teams, and players.
The broader goal is aligned with the literature review direction: use L2M data to investigate officiating quality, call recognition, and potential patterns in high-leverage moments.Read the full README ↗This project analyzes the NBA Last Two Minute (L2M) Report through an interactive Flask dashboard.
The L2M report is the league's transparency initiative for officiating decisions in the final two minutes of close games (fourth quarter and overtime). This app turns that raw report data into a decision-quality dashboard focused on trends, call types, teams, and players.
The broader goal is aligned with the literature review direction: use L2M data to investigate officiating quality, call recognition, and potential patterns in high-leverage moments.
Each event is classified into one of four outcomes:
CC - Correct CallCNC - Correct No-CallIC - Incorrect CallINC - Incorrect No-CallTwo key metrics are used throughout the dashboard:
CC / (CC + IC)CC / (CC + INC)The source dataset includes rich context. The dashboard currently relies most on the fields below:
gid, date, season, playoff, home, away, home_score, away_scorecall, type2 (normalized type), decision, commentscommitting, committing_team, disadvantaged_teamCurrent data scale from the project research notes:
The UI is organized into tabs with filterable views (season, stage, team, call, and min sample):
CC, IC, INC, plus accuracy and recognitionCC, CNC, IC, INCIC and INC eventsl2m_app/app.py - Flask app and API endpointsl2m_app/data.py - loads the static dataset into an in-memory SQLite databasel2m_app/templates/index.html - dashboard layout and client-side logicl2m_app/static/style.css - dashboard stylingdata/l2m_slim.csv.gz - the dataset the app runs on (committed, ~0.7 MB)data/L2M_stats_nba.csv - archival full export, 64 columns (not used at runtime)pip install -r requirements.txtpython -m l2m_app.apphttp://127.0.0.1:5000Set L2M_DEBUG=1 to enable the Flask debug reloader. It is off by default.
This is a static dashboard. There is no ETL, no scheduled job, and nothing to operate: the app ships one data file and reads it.
On startup, l2m_app/data.py decompresses data/l2m_slim.csv.gz and loads it into an
in-memory SQLite database, adding indexes on season, decision, committing_team,
disadvantaged_team, and (call, type2). Flask then serves JSON endpoints backed by
ordinary SQL:
/api/meta/api/call-types/api/decision-breakdown/api/season-trends/api/team-errors/api/recent-games/api/top-playersThe front-end fetches these and re-renders tables and charts whenever filters change.
Loading takes well under a second and happens once per process, so it is paid on cold start and never again. This is what lets the app run on a read-only, serverless filesystem while keeping every query in SQL.
Each thread gets its own connection onto that one shared in-memory database. A single connection shared across threads returns corrupted results under the parallel fetches the dashboard issues on load.
data/l2m_slim.csv.gz is a snapshot. To rebuild it, select these 15 columns -- the only
ones any endpoint reads -- from the l2m table of the full dataset, ordered by rowid,
and write them as UTF-8 CSV compressed with gzip:
gid, date, season, playoff, home, away, home_score, away_score,
call, type2, decision, committing, committing_team, disadvantaged_team, game_details
Every column is TEXT. Keep it that way when reloading: gid values such as
0021400883 lose their leading zeros under a numeric type affinity.
Deployed on Vercel, which detects Flask from pyproject.toml and runs it as a serverless
function. Relevant configuration:
pyproject.toml - dependencies, and tool.vercel.entrypoint pointing at l2m_app.app:app.python-version - pins Python 3.13vercel.json / .vercelignore - keep the archival CSV and local database out of the bundleDeploying means pushing to the connected Git branch. Refreshing the data means regenerating
data/l2m_slim.csv.gz and committing it -- the dataset is baked into each deployment.