Overview

Overview

Bradley Analytics is a free NBA analytics platform built by one person, Alex Bradley: a website with live game windows that follow every NBA game as it happens, and a full analytics dashboard that turns any player, team, lineup or season since 1996-97 into professional, interactive visualizations.

It has three parts that work together:

Everything is built on real NBA data, updated live, and every chart is interactive: hover over it on a computer, or hold and run your finger over it on a phone, to see the numbers behind any point.

Why This Matters

Front offices, coaches, scouts and media all lean on visuals like these to see what a box score can’t: where a player scores from, which lineups actually work, how a game swung, what a contract does to a cap sheet. Those tools usually sit behind team walls or paid subscriptions. Bradley Analytics puts the same kind of analysis in front of anyone, for free, and makes it fast to read: one click from a question to a chart.

It’s also built to grow past the NBA. Coaches and players at any level can upload their own stats and get the same analysis, which is the foundation for bringing professional-grade analytics to youth basketball.

And it’s a working portfolio of the full analytics pipeline: pulling live data from public APIs, cleaning and modelling it, inventing new metrics, designing the visuals, and shipping it all as a product people use every night.

Portfolio:
Bradley Analytics Instagram


Features

Live Game Windows

Every game of the night, as it happens, on the website’s home page (one tap on Full screen shows every window at once), with Live Leaderboards under them:

Every graph in them answers the pointer: hover for the lead at any moment, a shot’s details, a pair’s net rating or who a player assisted.

Search by Player and Search by Team

Pick any player or team and any season since 1996-97, then choose from 18 visualizations:

Search by Criteria

Search the whole league instead of one player:

On/Off Lineup Network

Every combination of teammates who shared the court this season, connected and colored by that group’s net rating, and how a team’s numbers shift with any two or three players on the floor together.

Front Office and Coaching

Ask anything about basketball — stats, comparisons, history, rules — or about the dashboard itself, and get an answer with a link straight to the right chart or tool.

Build, Share and Bring Your Own Data

Bradley Analytics Invented Stats

Original 0-100 ratings built from real NBA data:

Interactive, Downloadable Charts

Every chart shows the numbers behind each point in a pop-up. Keep any pop-up on screen (hold ctrl and click on a computer; lift your finger on a phone), drag it anywhere, and download the chart as a PNG with your pop-ups in it.


How It Works

The Bradley Analytics engine running: one command, then the charts it makes

Architecture Diagram

                     bradley-analytics.com
            (GitHub Pages: HTML, CSS and JavaScript)
                  |                          |
                  v                          v
     Live game windows             The dashboard (embedded)
   ESPN's public live feed,      Streamlit app in Python
   read in the visitor's             |
   browser every few seconds         v
                              NBA stats API (nba_api)
                              + Bradley data files
                              (ratings, salaries, rosters)
                                     |
                                     v
                         Data processing (pandas, numpy)
                                     |
                                     v
                    Charts (matplotlib) + interactive layer
                   (hover / hold pop-ups, pins, PNG export)

Workflow

1. A visitor opens the website
                |
                v
2. The live windows load tonight's games straight from
   ESPN and follow them play by play
                |
                v
3. In the dashboard, they pick a player, team or criteria
   and a visualization
                |
                v
4. Python pulls the NBA data and cleans it
                |
                v
5. The chart is drawn, made interactive, and shown --
   ready to hover, pin, share or download

The original command-line engine follows the same path with R at the end: Python gathers the data, and R (ggplot2) draws a shot chart, heat map, hex chart, bar chart, scatter plot or animated shot chart as a PNG or GIF.


Technologies Used

Programming Languages

Data

Visualization

App and Website

Development Tools

Analytics Skills Applied


Project Structure

Bradley Analytics Software Engine/
│
├── streamlit/              The dashboard
│   ├── app.py              every page of the dashboard
│   ├── visuals.py          every chart
│   ├── interactive.py      the charts' pop-ups, pins and downloads
│   ├── hotspots.py         what each part of a chart shows
│   ├── nba_data.py         NBA data, cached
│   ├── ai_search.py        AI Search
│   ├── criteria_tools.py   Search by Criteria
│   ├── upload_stats.py     Upload Stats
│   ├── cba_guide.py        the CBA guide
│   └── ...                 teams, pickers, salary table and more
│
├── docs/                   The website (bradley-analytics.com)
│   ├── index.html          Home: live tape, windows and leaderboards, dashboard, video
│   ├── games.html          Games, and games/blacktop/ (Blacktop 1v1)
│   ├── portfolio.html      Portfolio
│   ├── consulting.html     Consulting
│   ├── overview.md         this page
│   ├── author.md           Author
│   └── assets/             live windows, banner, scripts and images
│
├── python/                 The original engine (Python)
├── r/                      The original engine's charts (R)
├── data/                   Ratings, tendencies, rosters and salaries
├── scripts/                Live-window backup data and keep-alive
├── ai_assistant/           AI Search's instructions and tools
├── reports/                Bradley Analytics reports
├── assets/                 README images and banner
├── worker/                 Live game notifications (Cloudflare Worker)
│
├── README.md
├── LICENSE
├── requirements.txt
├── settings.json
└── bradley.bat

Installation

Setup

Clone the Repository

git clone https://github.com/alexbrxdley/Bradley-Analytics-Software-Engine.git

Navigate into the project folder:

cd "Bradley Analytics Software Engine"

Install Python Dependencies

pip install -r requirements.txt

Install Required R Packages

The engine uses R for generating visualizations. Make sure R is installed locally before running the software.

Open R and install the required packages:

install.packages("tidyverse")
install.packages("ggplot2")
install.packages("hexbin")
install.packages("ggfx")
install.packages("ggimage")
install.packages("scales")
install.packages("jsonlite")
install.packages("gifski")

Usage

Launch the Bradley Analytics Software Engine:

Windows:

.\bradley.bat

Mac:

python3 python/bradley_analytics.py

The engine will guide you through:

  1. Searching by player or team
  2. Choosing a visualization (Court Graphs, Axis Graphs, or Animated)
  3. Court Graphs and Animated: entering a player/team and season Bar Chart: choosing a stat, how many to show, season, and orientation Scatter Plot: choosing two stats (Y axis, then X axis), how many to show, and season
  4. Selecting an accent color (team name or a color code), every visualization except Scatter Plot, which shows no color at all (images only)

Shot Chart Example:

Search by player, team or criteria
1. Player
2. Team
3. Criteria

Choose an option: 1

Available Visualizations

Court Graphs:
1. Shot Chart
2. Heat Map
3. Hex Shot Chart

Axis Graphs:
4. Bar Chart
5. Scatter Plot

Animated:
6. Animated Shot Chart

Choose visualization: 1

Enter player name: Jayson Tatum

Available Seasons

1. 2017-18
2. 2018-19
3. 2019-20
4. 2020-21
5. 2021-22
6. 2022-23
7. 2023-24
8. 2024-25
9. 2025-26

Choose season: 9

For visualization color, enter team name or a color code: Celtics

Accent color: #007A33

Bar Chart (option 4) follows a different order after it’s selected: it asks for a stat, how many entities to show, season, and orientation, before finishing with the same accent color prompt.

Scatter Plot (option 5) follows a different order too: it asks for a first stat (Y axis), then a second stat (X axis), how many entities to show, and season, with no orientation and no color prompt at all (the chart uses player headshots or team logos, not a colored fill). Both stat prompts share the same categorized picker, with Bradley Analytics’ own invented ratings listed first.

Animated Shot Chart (option 6) follows the exact same player/team and season flow as the Court Graphs above, just kept in its own category so it’s not confused with the static charts.

The engine will automatically:

Generated visualizations are saved in:

visualizations/

Customization

Every tunable value across every visualization: colors, sizes, shadow effects, minimum-attempts qualifiers, and more, all live in one file at the project root:

settings.json

Open it in any text editor, change a value, save, and run the engine again, no code changes needed. Settings are grouped by which visualization they affect (shot_chart, heat_map, hex_shot_chart, animated_shot_chart, bar_chart, scatter_plot), plus bradley_ratings for the formula behind every Bradley Analytics invented stat, and shared sections for colors, output dimensions, and data-fetching behavior (like min_games_played, which filters out small-sample-size players from Bar Chart and Scatter Plot leaderboards).


Example Output

Example generated files:

visualizations/

jayson-tatum_2023-24_shot-chart.png
jayson-tatum_2023-24_heat-map-chart.png
jayson-tatum_2023-24_hex-shot-chart.png
top-10-bradley_3pt_rating_2025-26_bar-chart.png
top-10-bradley_3pt_rating-vs-3pa_2025-26_scatter-plot.png
jayson-tatum_2023-24_animated-shot-chart.gif

These visualizations can be used for: