Git Product home page Git Product logo

riot-api-challenge-2's Introduction

riot-api-challenge-2

This is my submission for Riot's API Challenge #2 ( https://developer.riotgames.com/discussion/announcements/show/2lxEyIcE )

A link to the web app showing off the analysis can be seen here: http://rylais-resolve.herokuapp.com/

There are two parts to this repository:

The analysis folder:

Everything in the analysis folder was used in order to generate the data needed for the web app. What's not included are the databases generated (due to Riot's rules about spreading out collected data), but they can be generated again with access to the AP_ITEM_DATASET (available here: https://s3-us-west-1.amazonaws.com/riot-api/api_challenge/AP_ITEM_DATASET.zip ). You do not need to do additional analysis runs to run the web app. Everything collected has been stored into the JSON folder, included in the repo.

If you do want to pull data and analyze it, you might need to comment or un-comment certain lines, but every file has a main function that does something. The order is as follows:

  • file_calls.py : This makes API calls (requires Riot API key), using the match data from the AP_ITEM_DATASET, in order to generate a folder full of thousands upon thousands of match .json results. I'm not convinced this was a great method, but it's the one I chose. Due to API limiting, I thought it was okay to have ~10 GB worth of pure .json match history on my harddrive, just in case.
  • api_calls.py : Has no actual main method, but file_calls and profile_builder use this to receive information from the Riot API.
  • profile_builder.py : This creates an actual class containing all the information I need for one participant in one match. This class is the basis for creating the database tables in...
  • db_calls.py: This uses those profiles created by profile_builder and starts adding rows to the database table 'Profile.' I then use those rows to generate additional tables as needed for the data I need for the web app. Once I have those extra tables, there's also methods in there to generate JSON files based off those database tables. These JSON files are used by dynatable and CanvasJS in order to display charts and graphs on the web app.
  • helper.py : Additional methods used to help db_calls

The Flask Application

  • If you're simply interested in seeing the app, all you need to do is run app.py as a Flask app, and it should work!
  • If the tables don't appear, you will need to go into tables.js and make sure that you're pointing to specific JSON sources. Each table has a corresponding json file in the static/json folder, but they need to be hosted somewhere. I used myjson.com to host the data, but you can use whatever.
  • After that, you should be able to simply run the app.py Flask app (I use either the default Flask run through PyCharm, or I host it on Heroku and use gunicorn), and the web app should generate all those pretty tables!

Any questions, feel free to message me. :)

riot-api-challenge-2's People

Contributors

matthewrmettler avatar

Watchers

James Cloos avatar  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.