pubg-toolbox

Simple queries and handles for PUBG data analysis


License
MIT
Install
pip install pubg-toolbox==0.0.5

Documentation

pubg-toolbox

A set of API wrappers to query PUBG game data according to official APIs, read it to learn more details.

Essentially the APIs needed, at least for my project, provide simple ways to get get pubg data in json format given the player name, platform and season. As for what to process with the obtained data, they are up to use cases. Therefore this toolbox focus on getting the data easily.

Goal 0.1:

  • Complete APIs listed to get json data in an easy and stable manner
  • Exception handling for query failure
  • Tests complete

Goal 0.2:

  • Add APIs to retrieve frequently used data from json returned

How to Use

Client

Creating a client is easy

from pubg_toolbox.client import PUBGClient
client = PUBGClient('<API key>')

Player

from pubg_toolbox.data_types.queries import PlayerQuery
from pubg_toolbox.data_types.types import Player

data = client.request(PlayerQuery('<id>', '<platform>'))
player = Player(data)

Seasons

from pubg_toolbox.data_types.queries import SeasonsQuery
from pubg_toolbox.data_types.types import Seasons

data = client.request(SeasonsQuery('<platform>'))
seasons = Seasons(data)

Get a list of season ids by

seasons.get_all_seasons()

Get current season id by

seasons.get_current_season()

Matches

from pubg_toolbox.data_types.queries import MatchesQuery
from pubg_toolbox.data_types.types import Matches

data = client.request(MatchesQuery('<account id>', '<season is>'))
matches = Matches(data)

Get match ids per game modeby

matches.get_matches('matchesSolo')

Match

from pubg_toolbox.data_types.queries import MatchQuery
from pubg_toolbox.data_types.types import Match

data = client.request(MatchQuery('<match id>'))
match = Match(data)

The most important feature is to get the telemetry url so we can look further into it:

match.get_telemetry_url()

Telemetry

Telemetry is a bit more complicated as you need get a match first. With the Match object created from above, use get_telemetry_url to get the telemtry CDN url.

from pubg_toolbox.data_types.queries import TelemetryQuery

data = client.request(TelemetryQuery('<telemetry url>'))