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.
Choose the installation method appropriate for your Operating System:
Linux (Ubuntu)
(Note: Thonny is available for Linux, too. If interested, see Windows section below.)
Install Python:
sudo apt-get install python3-pip
Edit Python scripts using your favorite text editor (e.g., emacs).
Run your python scripts with:
python3 my-script.py
Windows
Download and install Thonny:
http://thonny.org/
Thonny includes a basic Python editor.
Run your python scripts with F5 (or click the green "play" button).
The Riot API is an Application Programmer Interface (API) for retrieving game data for the popular computer game League of Legends.
Sign up for a League of Legends account (free):
Sign in to the Riot API Dashboard
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).
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:
Linux
Use pip to install (may need administrator/root access):
pip install riotwatcher
Windows
Open Thonny. Then open a shell
"Tools" → "Open system shell"From inside the shell, use pip to install:
pip install riotwatcher
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" }
Choose the installation method appropriate for your Operating System and install a spreadsheet:
Windows - Microsoft Excel (part of Office):
https://it.wpi.edu/Article/Install-Microsoft-Office-2016-on-Windows
Linux - LibreOffice
sudo apt-get install libreoffice
Return to the IMGD 2905 Project 1 page
Questions: imgd2905 question-answer forum