def make_spells_dict(): champ_dict = {} api = RiotAPI('be8ccf5f-5d08-453f-84f2-ec89ddd7cea2') champs = api.get_all_champs() for champ in champs['data'].keys(): champ_dict[champ] = {} return champ_dict
def make_spells_dict(): champ_dict = {} api = RiotAPI('be8ccf5f-5d08-453f-84f2-ec89ddd7cea2') champs = api.get_all_champs() for champ in champs['data'].keys(): champ_dict[champ] = {} return champ_dict
def _fill_champ_id_range(csv_data, data_col_base): #fill out champ ids and attack range api = RiotAPI('be8ccf5f-5d08-453f-84f2-ec89ddd7cea2') champs = api.get_all_champs({'champData': 'stats'}) for col in range(csv_data.shape[0]): name = _get_name(col) csv_data[col][0] = champs['data'][name]['id'] csv_data[col][data_col_base + Consts.VARIABLE_TO_MATRIX['atk_range']] = champs['data'][name]['stats']['attackrange']
def _fill_champ_id_range(csv_data, data_col_base): #fill out champ ids and attack range api = RiotAPI('be8ccf5f-5d08-453f-84f2-ec89ddd7cea2') champs = api.get_all_champs({'champData': 'stats'}) for col in range(csv_data.shape[0]): name = _get_name(col) csv_data[col][0] = champs['data'][name]['id'] csv_data[col][data_col_base + Consts.VARIABLE_TO_MATRIX['atk_range']] = champs['data'][ name]['stats']['attackrange']
#used to make a CHAMP_TO_MATRIX for FetchData.py (converting from champion to index) import requests import RiotConsts as Consts from RiotAPI import RiotAPI import json api = RiotAPI('be8ccf5f-5d08-453f-84f2-ec89ddd7cea2') champs = api.get_all_champs() champ_dict = {} index = 0 for champ in champs['data'].keys(): champ_dict[champ] = index index += 1 with open('champ_dict.json', 'w') as fp: json.dump(champ_dict, fp)
#used to make a CHAMP_TO_MATRIX for FetchData.py (converting from champion to index) import requests import RiotConsts as Consts from RiotAPI import RiotAPI import json api = RiotAPI('be8ccf5f-5d08-453f-84f2-ec89ddd7cea2') champs = api.get_all_champs() champ_dict = {} index = 0 for champ in champs['data'].keys(): champ_dict[champ] = index index += 1 with open('champ_dict.json', 'w') as fp: json.dump(champ_dict, fp)