Skip to content

Instantly share code, notes, and snippets.

@RyanHope
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RyanHope/69cdaf07a1814b1c51ec to your computer and use it in GitHub Desktop.
Save RyanHope/69cdaf07a1814b1c51ec to your computer and use it in GitHub Desktop.
import pickle
import os
from riotwatcher import RiotWatcher
with open (os.path.expanduser("~/.riot.key"), "r") as keyfile:
w = RiotWatcher(keyfile.read().replace('\n', ''))
champions = w.get_all_champions()
championsStatic = w.static_get_champion_list()
champNameLookup = {}
for n in championsStatic['data'].keys():
champNameLookup[championsStatic[n]['id']] = n
champDynamic = {}
for c in champions['champions']:
champDynamic[c['id']] = c
with open ("champions.dat", "w") as output:
pickle.dump([champions,championsStatic,champDynamic],output)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment