Skip to content

v-rdyy/NBA-Stats-Comparison

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NBA Stats Comparison Tool

A web application for comparing NBA player statistics across different seasons. Built with Python, Flask, and BeautifulSoup.

Features

  • Compare any two NBA players' seasons side-by-side
  • Extract stats from basketball-reference.com
  • View 9 key statistics: PPG, MPG, FG%, 3PT%, eFG%, TS%, APG, RPG, Stocks, and Turnovers
  • Color-coded comparison (green for better, yellow for ties)
  • Recent comparisons history (up to 5)
  • Dark mode interface

Installation

  1. Clone the repository
  2. Create a virtual environment:
    python3 -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install dependencies:
    pip install -r requirements.txt

Usage

  1. Start the Flask server:
    python3 app.py
  2. Open your browser to http://localhost:5001
  3. Enter two player names and their respective seasons
  4. Click "Compare Stats" to see the comparison

Project Structure

  • app.py - Flask application and routes
  • extract_table.py - Web scraping logic and stat extraction
  • templates/ - HTML templates (index.html, results.html)
  • requirements.txt - Python dependencies

Notes

  • The secret key in app.py is a placeholder. Change it for production use.
  • Stats are scraped from basketball-reference.com. Be respectful with request frequency.
  • The application uses Flask sessions to store comparison history.

About

Compare any 2 Individual Player Seasons

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors