Skip to content

Interactive NBA Analytics app with Streamlit and a LangChain conversational agent connected to extracted data. Explore player, team, and game stats, track injuries, run simulations, visualize trends, and get AI-powered insights. Ongoing development, open to collaboration.

Notifications You must be signed in to change notification settings

petermartens98/NBA-Analytics-Streamlit-App-with-LangChain-Agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NBA Analytics Streamlit App with LangChain Agent

Project Overview

The NBA Analytics Streamlit App provides interactive dashboards for player, team, and game stats. It integrates a LangChain Agent for AI-powered insights and natural language queries, enabling users to explore performance metrics, head-to-head comparisons, and game-level analytics in real time.

The Project is Currently in Continuing Development, and Open to Collaboration.


Features

Feature Description
Today's Matchups View today’s games with key stats and predictions.
Injuries Track current player injuries and impact to team.
All Players Overview of all player stats, performance trends, shot selection, player archetypes, and impact players; filterable on team.
Single Player Detailed profile and analytics for an individual player; including game logs, career stats, performance trends, shooting analysis, and player impact.
All Teams Overview of all teams stats, shooting analysis, ball movement, home/away trends, defense and a team comparison tool
Single Team Detailed overview and analytics for an individual team; including rosters, game logs, scoring efficiency and trends.
Simulation Simulate games or matchups based on player/team data.
Chat Ask questions and get AI-generated insights via LangChain agent.

Dependencies & Purpose

Library Purpose / Usage in Project
streamlit Powers the interactive web app, including dashboards, tabs, charts, and UI components.
beautifulsoup4 Enables web scraping of additional NBA or media data not available via official APIs.
pandas Core data manipulation library for cleaning, filtering, and structuring player, team, and game data.
nba_api Provides access to official NBA statistics for real-time and historical data.
plotly Creates interactive visualizations such as performance trends and matchup dashboards.
matplotlib Supports static or advanced plotting for detailed analytics visualizations.
langchain Framework for AI reasoning workflows; connects NBA data to AI agents for generating insights.
langchain-openai Integrates OpenAI models for natural language queries, powering the Chat tab.
langchain-community Adds community-supported tools and connectors to enhance AI workflows and data integration within LangChain.

Getting Started

  1. Clone the repository
git clone https://github.com/petermartens98/NBA-Analytics-Streamlit-App-with-LangChain-Agent
cd NBA-Analytics-Streamlit-App-with-LangChain-Agent
  1. Create a virtual environment
python -m venv venv
  1. Activate the virtual environment
  • Windows:
venv\Scripts\activate
  • Mac/Linux:
source venv/bin/activate
  1. Install dependencies
pip install -r requirements.txt
  1. Run the app
streamlit run streamlit_app.py

Screenshots

Today's Matchups Tab

image

Injuries Tab

image

Players Tab

image image image image image image

Single Player Tab

image image image image image image image image

Teams Tab

image image image image image image image image image image

Single Team Tab

image image image image image image

Simulation Tab

image image

Chat Tab

image

About

Interactive NBA Analytics app with Streamlit and a LangChain conversational agent connected to extracted data. Explore player, team, and game stats, track injuries, run simulations, visualize trends, and get AI-powered insights. Ongoing development, open to collaboration.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages