GithubHelp home page GithubHelp logo

samirps / rocketleague_graphql Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 578 KB

Use of GraphQL,Python and Sqlite to parse some data on RocketLeague Liquipedia

License: Apache License 2.0

Python 100.00%
graphql liquipedia python python3 rocketleague sqlite

rocketleague_graphql's Introduction

RocketLeague_GraphQL

Run Script

Introduction

I created this project to learn how to use GraphQL with python. For this, I used data from the game Rocket League (Team, Region, Player) available via the site: https://liquipedia.net/rocketleague and their api.

Installation

First you need to install the dependencies:

pip install -r requirements.txt

After this, you just need to do the following:

export FLASK_APP=app.py
flask run

And go to http://localhost:5000/

Scrapping

In order to get the data, i use the api of the Liquipedia Rocket League Website and you can see the limitation and TOS of the API here :

https://liquipedia.net/api-terms-of-use

You can see the function to scrap the teams in the test_scrap.py file.

Database

The database is a sqlite3 database.In order to add the data to the database, you can use the script db_to_add.py or with a tool like sqlitebrowser.

Methods

Teams

Get all teams

If you want to get all the teams in the Sqlite database, you can use the following query:

query {
  listAllTeams{
  teams {
    id
    region
    name
    player_one
    player_two
    player_three
    player_sub
    coach
  }
}
}

Get a team by name

If you want to get information about a team thanks to the name of the team.Use the following query:

query {
  getTeam_ByName(name: "NRG"){
  team {
    id
    region
    name
    player_one
    player_two
    player_three
    player_sub
    coach
  }
}
}

Get a team by region

If you want to get information about all the teams in a region.Use the following query:

query {
  getTeam_ByRegion(region: "EU"){
  teams {
    id
    region
    name
    player_one
    player_two
    player_three
    player_sub
    coach
  }
}
}

Region

Get all regions

If you want to get all the regions in the Sqlite database, you can use the following query:

query {
  listAllRegions {
    region {
      name
    }
  }
}

Player

Get all players

If you want to get all the player (Only a few right now ) in the Sqlite database, you can use the following query:

query {
  listAllPlayers {
    player {
      id
      name
      nationality
      born
      status
      team
      winningmonney
      otherpseudo
      pseudo
    }
  }
}

Get a player by name

If you want to get information about a player thanks to the name of the player.Use the following query:

query {
  getPlayer_ByName(name: "Axel Touret") {
    player {
      id
      name
      nationality
      born
      status
      team
      winningmonney
      otherpseudo
      pseudo
    }
  }
}

Get a player by pseudo

If you want to get information about a player thanks to the pseudo of the player.Use the following query:

query {
  getPlayer_ByPseudo(pseudo:"FabiDerKrosse"){
    player {
      id
      name
      nationality
      born
      status
      team
      winningmonney
      otherpseudo
      pseudo
    }
  }
}

Transfers

Get all transfers

If you want to get all the Transfers listed in the Sqlite database, you can use the following query:

query {
  listAlltransferts {
    success
    errors
    transfert {
      id
      players
      oldteam
      newteam
      date
    }
  }
}

Matches

Get all matches

If you want to get all the matches in the Sqlite database, you can use the following query:

query {
  listAllMatches {
    success
    errors
    matche {
      id
      team_un
      team_deux
      countdown
      score
    }
  }
}

rocketleague_graphql's People

Contributors

samirps avatar

Watchers

 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.