This is the repository for Caltech CS 121 final project
We used the prettytable
to format our output, the mysql-connection-python
to connect the Mysql to Python, therefore you must install them before using.
pip install prettytable
pip install mysql-connector-python
The data we used comes from NBA Games Dataset. We modified the original data and produced the following 5 csv files.
- teams.csv
- games.csv
- players.csv
- games_details.csv
- ranking.csv
The data is too large and exceeds the file size limits for CodePost, therefore please pull the data from the github
git clone https://github.com/tommyfan34/CS121_final_project
The data is included in this repo.
$ cd your-files
$ mysql
mysql> CREATE DATABASE nba;
mysql> USE nba;
mysql> source setup.sql;
mysql> source load-data.sql;
mysql> source setup-passwords.sql;
mysql> source setup-routines.sql;
mysql> source grant-permissions.sql;
mysql> source queries.sql;
mysql> quit;
$ python3 app.py
[-d] For debug mode
- For ordinary users
- Look up a player's stats for a given year
- Look up each team's score leader
- Look up team stats for a given date
- For admin users
- Modify the team information, including the owner, manager and coach
We have 2 sample users for testing
username | password | is_admin? |
---|---|---|
tommyfan34 | tfpswd | No |
NJUWJJ | wjjpswd | Yes |