Simple queries and handles for PUBG data analysis
Project description
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
- API names clean up
- 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)
Get recent played match ids
player.matches
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()
You can also get useful information such as
match.created_at # match date
match.get_match_map() # match map
match.get_game_mode() # match game mode
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>'))
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pubg-toolbox-0.0.5.tar.gz
.
File metadata
- Download URL: pubg-toolbox-0.0.5.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59a5a177bdff818a7c424061df6159a3bda20a6d27e43a43f4b88cc1c2311acb |
|
MD5 | b19fda36e7f9b6cc1c589d7748a52d1f |
|
BLAKE2b-256 | 962ec440e65aef69a18fcc8056bc87d08a3830fa40d65059c80c53278a427136 |
File details
Details for the file pubg_toolbox-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: pubg_toolbox-0.0.5-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa908e85cdc7e19ca17ea258e70f1f505f3dbc144cc2aa3845fb5c26a9a08e86 |
|
MD5 | 8fff0b0d6d383b1666288f8bf5721b04 |
|
BLAKE2b-256 | a8e42ba7577224abfc6723ee083c73a53c457f14cdc670315de212fafd21c088 |