NBA Games Real Time Database
This README provides an overview of the directory and file structure for this project, which is designed to interact with NBA data using a Flask web application and MySQL databases.
This directory stores the raw data for the project.
0
: Contains data for thenba_0
database.1
: Contains data for thenba_1
database.
Stores processed data ready for import into databases. Each subdirectory contains four CSV files: all_draft_picks.csv
, all_players_season_stats_2023_2024.csv
, current_players.csv
, and player_info.csv
.
0
: Data fornba_0
.1
: Data fornba_1
.
Contains static assets for the web application.
css
: This subdirectory contains the CSS fileindex_styles.css
used for styling the web application.
Holds all HTML files used by the Flask application.
- Files:
index.html
,login.html
,player_stats.html
,query.html
,signup.html
.
- app.py: The Flask application file that also manages connections to the MySQL server for data retrieval.
- Data_Collecting.ipynb: A Jupyter notebook for collecting raw data using the
nba_api
package and performing data cleaning. - Data_Sharding.ipynb: A Jupyter notebook used for sharding data across the
nba_0
andnba_1
databases. - insert_initial_data.py: A Python script designed to facilitate the easy insertion of player data into databases. It handles connecting to the MySQL server, database creation, table creation, and data insertion.
- README.md: Provides context about the project, outlining its structure and instructions for replication.
- schema.sql: Contains the SQL commands to create the necessary database tables as designed for the project.
This structure supports efficient management and processing of data, allowing for a robust development environment for handling NBA statistics.
Before running any code, please redirect your repository to DSCI551-Project
cd DSCI551-Project
insert_initial_data.py
would automatically insert initial data into local MySQL server. If you try to open the following application without inserting any data, you will only see the structure of the webpage but without any players data.
python insert_initial_data.py password
Replace password
to your local MySQL root user password. It shouldn't be empty.
app.py
is the python script that connects the frontend and the backend. You will need to run this script to see the webpage.
python app.py password
Replace password
to your local MySQL root user password. It shouldn't be empty.