masterblaster#

Submodules#

Package Contents#

Classes#

Header

Wrapper for http header-fields

MasterBlaster

MasterBlaster is the main class for interacting with the MasterBlaster API

Member

Class for organization members

Image

MasterBlaster Image Object

GameAccount

Class for GameAccount objects, related to one player

Player

Class for Player objects, related to zero or more gameaccounts

Player

Class for Player objects, related to zero or more gameaccounts

Schedule

Class holding all information about scheduled competitions for a team

Team

Schedule

Class holding all information about scheduled competitions for a team

Organisation

Attributes#

BASE

class masterblaster.Header[source]#

Bases: collections.abc.MutableMapping

Wrapper for http header-fields

Variables:

fields – The header fields

add(name: str, value: str) Header[source]#

Add a header field

Parameters:
  • name (str) – The name of the header field

  • value (str) – The value of the header field

Returns:

The header object

Return type:

Header

remove(name: str) Header[source]#

Remove a header field

Parameters:

name (str) – The name of the header field

Returns:

The header object

Return type:

Header

class masterblaster.MasterBlaster(access_token: Optional[str])[source]#

MasterBlaster is the main class for interacting with the MasterBlaster API

Parameters:

access_token (Optional[str]) – The access token for the organization

Variables:
  • access_token – The access token for the organization

  • headers – The headers used for the session

async teardown() None[source]#

Close the session

Parameters:

None

Return type:

None

async classmethod create(access_token: str) MasterBlaster[source]#

Create a new fully setup MasterBlaster instance

Parameters:
  • access_token (str) – The access token for the organization

  • org_name (str) – The name of the organization

Return type:

MasterBlaster

async set_access_token(access_token: str) None[source]#

Set the access token for the organization Will update the session

Parameters:

access_token (str) – The access token for the organization

Return type:

None

async get_org(org_id: str) masterblaster.organisation.Organisation[source]#

Returns the organization for the given organization id

Parameters:
  • (str) (org_id) –

  • org_id (str) –

Return type:

Organisation

async get_org_by_name(org_name: str) masterblaster.organisation.Organisation[source]#

Returns the organization for the given organization name Users can be associated with multiple organizations with the same name, so this function will return the first one :param org_name (str): :type org_name (str): The organization name

Return type:

Organisation

Parameters:

org_name (str) –

async get_all_orgs() list[masterblaster.organisation.Organisation][source]#

Get all organizations for the current access token

Parameters:

None

Returns:

organisations

Return type:

List[Organisation]

class masterblaster.Member(player: dict, email: str, name: str, playerId: str, role: int, addedAt: str, invitedAt: Optional[datetime.datetime])[source]#

Class for organization members

Parameters:
  • player (dict) – The player object

  • email (str) – The member email

  • name (str) – The member name

  • playerId (str) – The player id

  • role (int) – The member role

  • addedAt (str) – When the member was added

  • invitedAt (Optional[datetime.datetime]) – When the member was invited

Variables:
  • player – The member’s related player object

  • email – The member’s email-address

  • name – The member’s name

  • player_id – The member’s player id

  • role – The member’s role

  • added_at – When the member was added

  • invited_at – When the member was invited

class masterblaster.Image(imageType: int, imageId: str, originalImageId: str)[source]#

MasterBlaster Image Object

Parameters:
  • imageType (int) – The type of image

  • imageId (str) – The id of the image

  • originalImageId (str) – The id of the original image

Variables:
  • type – The type of image

  • id – The id of the image

  • original_id – The id of the original image

class masterblaster.GameAccount(id: str, nick: str, avatarUrl: str, gameId: str, isConnected: bool, connectedAt: Optional[datetime.datetime])[source]#

Class for GameAccount objects, related to one player

Supported games: [“Counter-Strike”, “Rocket League”, “Chess”]

Parameters:
  • id (str) – The gameaccount id

  • nick (str) – The gameaccount nickname

  • avatarUrl (str) – The gameaccount avatar url

  • gameId (str) – The game id

  • isConnected (bool) – Whether or not the gameaccount is connected

  • connectedAt (Optional[datetime.datetime]) – When the gameaccount was connected

Variables:
  • id – The gameaccount id

  • nick – The gameaccount nickname

  • avatar_url – The gameaccount avatar url

  • gameId – The game id

  • isConnected – Whether or not the gameaccount is connected

  • connectedAt – When the gameaccount was connected

class masterblaster.Player(id: str, nickName: str, avatarUrl: str, registered: str, isProfileComplete: bool, gameAccounts: list[masterblaster.gameaccount.GameAccount])[source]#

Class for Player objects, related to zero or more gameaccounts

Parameters:
  • id (str) – The masterblaster id of the player

  • nickName (str) – The internal nickname of the player

  • avatarUrl (str) – The avatar url of the player

  • registered (str) – When the player was registered

  • isProfileComplete (bool) – Whether or not the player has completed their profile

  • gameAccounts (list[masterblaster.gameaccount.GameAccount]) – List of gameaccounts related to the player

class masterblaster.Player(id: str, nickName: str, avatarUrl: str, registered: str, isProfileComplete: bool, gameAccounts: list[masterblaster.gameaccount.GameAccount])[source]#

Class for Player objects, related to zero or more gameaccounts

Parameters:
  • id (str) – The masterblaster id of the player

  • nickName (str) – The internal nickname of the player

  • avatarUrl (str) – The avatar url of the player

  • registered (str) – When the player was registered

  • isProfileComplete (bool) – Whether or not the player has completed their profile

  • gameAccounts (list[masterblaster.gameaccount.GameAccount]) – List of gameaccounts related to the player

class masterblaster.Schedule(matches: list[dict])[source]#

Class holding all information about scheduled competitions for a team

Parameters:

matches (list[dict]) – List of matches

Variables:

matches – List of matches

get_next_match()[source]#
masterblaster.BASE = 'https://app.masterblaster.gg/api'#
class masterblaster.Team(session: aiohttp.ClientSession = None, id: Optional[str] = None, ownerPlayerId: str = None, organizationOwnerId: str = None, name: Optional[str] = None, tag: Optional[str] = None, flag: Optional[str] = None, shortHandle: Optional[str] = None, avatarImageId: str = None, bannerImageId: Optional[str] = None, socialLinks: list = None, gameId: str = None, players: list[dict] = None, createdAt: Optional[datetime.datetime] = None)[source]#
Parameters:
  • session (aiohttp.ClientSession) –

  • id (Optional[str]) –

  • ownerPlayerId (str) –

  • organizationOwnerId (str) –

  • name (Optional[str]) –

  • tag (Optional[str]) –

  • flag (Optional[str]) –

  • shortHandle (Optional[str]) –

  • avatarImageId (str) –

  • bannerImageId (Optional[str]) –

  • socialLinks (list) –

  • gameId (str) –

  • players (list[dict]) –

  • createdAt (Optional[datetime.datetime]) –

async get_schedule() masterblaster.schedule.Schedule[source]#

Returns the schedule for the team

Parameters:

None

Return type:

Schedule

class masterblaster.Schedule(matches: list[dict])[source]#

Class holding all information about scheduled competitions for a team

Parameters:

matches (list[dict]) – List of matches

Variables:

matches – List of matches

get_next_match()[source]#
class masterblaster.Organisation(session: aiohttp.ClientSession = None, id: str = None, name: str = None, members: list[dict] = None, images: list[dict] = None)[source]#
Parameters:
  • session (aiohttp.ClientSession) –

  • id (str) –

  • name (str) –

  • members (list[dict]) –

  • images (list[dict]) –

async get_members()[source]#

Returns members of the organization

Parameters:

None

Returns:

members – A list of all members in the organization

Return type:

list[Member]

async get_teams() list[masterblaster.team.Team][source]#

Returns teams of the organization

Parameters:

None

Returns:

teams – A list of all teams in the organization

Return type:

list[Team]

async get_images() list[masterblaster.image.Image][source]#

Returns images of the organization

Parameters:

None

Returns:

images – A list of all images in the organization

Return type:

list[Image]