Coder Social home page Coder Social logo

lolpy's Introduction

LoLpy

Python library for accessing League of Legends' API

##Getting Started:

  1. Import LoLpy.py into your python script.
  2. Initialize a new LoLpy object using LoLpy(API_KEY) where API_KEY is your applications key.
  3. Use LoLpy's methods to easily get information for your python applicatoin.

##Methods:

###getchampions() Returns a python dictionary with all the League of Legends champions and their attributes.

lolpy = LoLpy(API_KEY)
champions = lolpy.getchampions()

###get_summoner_by_name(summonerName) Returns a python dictionary with information about the summoner

lolpy = LoLpy(API_KEY)
game = lolpy.get_summoner_by_name('Trick2g')

###get_game(summonerName) Returns a python dictionary with information about the game a summoner is currently in and their recent games

lolpy = LoLpy(API_KEY)
game = lolpy.get_game('Trick2g')

###get_league(summonerName) Returns a python dictionary with information about the summoner's league

lolpy = LoLpy(API_KEY)
game = lolpy.get_league('Trick2g')

###get_stats_summary(summonerName) Returns a python dictionary with information about the summoner's stats

lolpy = LoLpy(API_KEY)
game = lolpy.get_stats_summary('Trick2g')

##Reducing API Calls:

  • Each method that takes a summoner name also has a method that takes a summonerID which can be found in the return of get_summoner_by_name(). This removes one request for every method.
  • To call these append "_by_id" to any method with the parameter summonerName other than get_summoner_by_name().
  • Example:
game = lolpy.get_game_by_id(summonerID)

##Notes:

  • To change region from NA, it can be changed in the contructor with the call LoLpy(API_KEY,region='EUW')
  • Some methods cannot be called with certain regions, be sure to check the API if you have issues with regions other than NA

lolpy's People

Contributors

redaxed avatar keemy avatar

Watchers

Eugene Chinveeraphan avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.