NBA Player Analysis is a web application that allows users to compare the statistics, awards, and personal information of NBA players. Users can view career statistics, career progression graphs, player awards and information, and a featured comparison of the day.
- Featured Comparison: Display a random featured comparison of the day.
- Smart (Ajax) Search: Implemented an intuitive search functionality using Ajax, allowing users to quickly and efficiently find players as they type. This feature provides real-time search results, enhancing the user experience by minimizing the need for page reloads and offering instant feedback.
- Career Progression Graphs: View the career progression of players in various stats.
- Dark Mode: Toggle between light and dark mode for a better viewing experience.
- Error Handling: Provides error messages for invalid player inputs.
- Backend: Django
- Frontend: HTML, CSS, JavaScript
- Data:
nba_api
package for fetching player statistics and information - Graphing: Matplotlib, Seaborn, Pandas
- Caching: Redis
- Web Scraping: Beautiful Soup for fetching additional player information
-
Clone the repository:
git clone https://github.com/yourusername/nba-player-comparison.git cd nba-player-comparison
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Set up your environment variables: Create a
.env
file in the root directory and add the following:SECRET_KEY=your_secret_key DEBUG=True ALLOWED_HOSTS=localhost,127.0.0.1
-
Run the development server:
python manage.py runserver
-
Open your browser and navigate to:
http://127.0.0.1:8000
-
Compare NBA Players:
- Use the autocomplete search bars to select two players.
- Click the "Compare" button to see their stats, awards, and personal information.
-
Toggle Dark Mode:
- Click the "Toggle Dark Mode" button to switch between light and dark themes.
- Icons:
- Basketball jersey icons created by Nikita Golubev - Flaticon.