Reference¶
Client¶
-
class
pubgy.client.
Pubgy
(auth_token, defaultshard=None)¶ Represents the core of PUBGy. Start by initializing an instance of it, using
import pubgy client = pubgy.Pubgy("your auth token")
Parameters: - auth_token (str) – The API Authentication token
- defaultshard – A Shard from the list of shards in
constants.SHARD_LIST
Returns: A Pubgy object to do requests from.
-
matches
(id, shard=None, sorts=None, filter=None)¶ This function is a coroutine.
Gets specific match info depending on the parameters supplied.
Parameters: - id (str) – Required.
- shard (str or None) – Defaults to Query.shard
- amount (int) – Defaults to 5, only returns the amount of match objects equal to length
- offset (int) – Defaults to 0, where to start parsing the stats from.
Returns:
-
player
(plyname, shard=None)¶ This function is a coroutine.
Gets a player’s stats by using either their player name or account id.
If given a list of player names/ids, they all must be the same type.
Parameters: plyname (str or list) – A Players name/ID Returns: objects.Player
-
samples
(shard=None, amount=1)¶ This function is a coroutine.
Gets sample matches from the /samples endpoint
Parameters: - shard (str or None) – Defaults to shard passed on client initialization
- amount (int) – Defaults to 1, only returns the amount of match objects equal to length
Returns: A list of
objects.Match
-
shard
¶ Returns the shard the client was initiated with. This is used as the default shard for all commands, unless another one is passed
Returns: str
-
solve
(telemetry)¶ This function is a coroutine.
Puts a Telemetry object into a useful set of data.
Parameters: telemetry (A Telemetry object with only telemetry.url filled.) – A telemetry object that has just been received from a match.
-
stats
(player, id=None)¶ This function is a coroutine. :param player: A player name :type player: str :param id: A player id (with account) :type id: str :return: A
objects.Player
with a filledobjects.Stats
property.
Objects¶
These are all the objects that PUBGy uses, which are both used internally and returned to the end user. Not recommended to build these yourself, unless you know what you are doing
-
class
pubgy.objects.
Match
(id, participants, shard, winners, telemetry, map, matchType=None)¶ A Match object Returned whenever
pubgy.client.matches()
is called.Parameters: - id (str) – The match id
- participants (list) – A list of
objects.Player
- shard (str) – Which shard did the match occur on
- winners (list) – A list of
objects.Player
- telemetry (str) – Telemetry URL
- map (str) – Which map did the match occur on
- matchType (str) – What gamemode type was the match
Returns: A built Match object
-
id
¶ Returns: A Match ID (str)
-
map
¶ Returns: Which map the game occurred on (str)
-
players
¶ Returns: A list of objects.Player
-
shard
¶ Returns: The shard the match occurred on (str)
-
telemetry
¶ Returns: The telemetry url (str)
-
winners
¶ Returns: A list of objects.Player
who won