IMGD 2905 Setup

Setup Game Analytics Pipeline Tools


The goal of this project is to set up tools for a game analytics pipeline. This project is not due, but will be used for most, if not all, of the remaining class projects.

Note, you may not need to do one or more of the below steps because they are already done, depending upon your environment (e.g., you've installed Python, have access to Microsoft Excel and/or have a Riot API key).

Both Windows and Linux environments are supported. For those interested in doing their projects on a Mac are on their own - but a slight modification of the instructions should work.


Top | Python | Riot API Key | RiotWatcher | Test | Spreadsheet

Install Python

Choose the installation method appropriate for your Operating System:


Get Riot API Key

The Riot API is an Application Programmer Interface (API) for retrieving game data for the popular computer game League of Legends.

  1. Sign up for a League of Legends account (free):

    https://signup.na.leagueoflegends.com/en/signup/index

  2. Sign in to the Riot API Dashboard

    https://developer.riotgames.com/sign-in

Note your personal API key after logging in (e.g., 12345678-abcd-9012-efgh-345678901234). These are not to be shared. For future use (you can always retrieve it by signing in again, step #2).


Install RiotWatcher

RiotWatcher is a thin wrapper on top of the Riot Games API for League of Legends. See

https://github.com/pseudonym117/Riot-Watcher

Choose the installation method appropriate for your Operating System:


Test It Out

Put the below script into a file called "hello.py":

#!/usr/bin/python3
#
# Basic "hello, world!" for Riot API.
# v1.1
#

# Bring in imports needed for data processing.
from riotwatcher import RiotWatcher
import json

# Replace below with my Riot developer key.
developer_key = '21e6bb30-08e1-47ed-946f-cee514b740d8'

# Get master RiotWatcher object, using my Riot developer key.
r_w = RiotWatcher(developer_key)

# Get "challenger" tier of LoL players.
challenger = r_w.get_challenger()

# Print out the 97th challenger player.
i = 96
print("Challenger player info:");
print(json.dumps(challenger['entries'][i], indent=3))

# Get list of all LoL champions.
static_champ_list = r_w.static_get_champion_list()

# Print out "Teemo" and "Leona"
print("-----------------");
champ = 'Teemo'
print("Teemo info:");
print(json.dumps(static_champ_list['data'][champ], indent=3))
champ = 'Leona'
print("Leona info:");
print(json.dumps(static_champ_list['data'][champ], indent=3))

Run it with:

python hello.py

(Linux users may need to use python3 instead. Thonny users can just hit F5 or click the green "play" button.)

If all is working, output should look similar to:

  Challenger player info:
  {
     "division": "I",
     "losses": 301,
     "playerOrTeamId": "21390175",
     "isInactive": false,
     "isHotStreak": false,
     "playerOrTeamName": "Fas the Magi",
     "wins": 338,
     "leaguePoints": 427,
     "isVeteran": true,
     "isFreshBlood": false
  }
  -----------------
  Teemo info:
  {
     "title": "the Swift Scout",
     "id": 17,
     "name": "Teemo",
     "key": "Teemo"
  }
  Leona info:
  {
     "title": "the Radiant Dawn",
     "id": 89,
     "name": "Leona",
     "key": "Leona"
  }

Install Spreadsheet

Choose the installation method appropriate for your Operating System and install a spreadsheet:


Top | Python | Riot API Key | RiotWatcher | Test | Spreadsheet

Return to the IMGD 2905 Project 1 page

Questions: imgd2905 question-answer forum