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