This is a group project that explores aspects of the Starcraft II ladder, mmr, and win ratio using Python scripts.
- Clone the repository to your local machine
- Set up the virtual env and install the dependencies:
$python3 -m venv env
$source env/bin/activate
(env)$pip install -r requirements.txt
- Go to the Blizzard Battle.net API and register an account.
- Get your own client ID and secret. Save them into a
.env
file under /API requests/ in the following format:
CLIENTID=<your client id>
SECRET=<your client secret>
- Set up your own mySQL server. This can be done on a local machine or using a web service provider like the RDS service on AWS. Once the database server is set up, input its credentials into a
.env
file in the following format:
DBHOSTNAME=<path to the database>
DBNAME=<your database name>
DBUSERNAME=<your database username>
PASSWORD=<your database password>
Alternatively, you can set up the a local database. You will need to specify the local database in
engine
in the following scripts:dataprocessing.py
andVisualizations.py
- Once everything is set up, simply execute
task.py
under the /API requests/ folder:
(env)$python3 task.py
- Alternatively, use crontab job scheduling for periodic updates of player and matches data:
$0 0 0 * * source/env/bin/activate && python3 task.py && deactivate
It is recommended that you use a cloud instance like AWS EC2 for crontab. For details of how cron job scheduling works check their documentations check the Wikipedia page.