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

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], org_name: str)[source]#

MasterBlaster is the main class for interacting with the MasterBlaster API

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

  • org_name (str) – The name of the organization

Variables:
  • id – The id of the organization

  • name – The name of the organization

  • is_admin – Whether or not the current token is an admin for the organization

  • access_token – The access token for the organization

  • members – A list of all members in the organization

  • images – A list of all images in 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, org_name: 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 get_org(org_id: str) dict[str, str | dict][source]#

Returns the organization for the given organization id

Parameters:
  • (str) (org_id) –

  • org_id (str) –

Returns:

Information about the organization

Return type:

json

async get_all_orgs() list[dict[str, Any]][source]#

Returns all organizations related to the current token

Parameters:

None

Returns:

Short information about all organizations related to current token

Return type:

json

async change_org(org_name: str) None[source]#

Change the organization Will re-initialize the organization: id, members, and images

Parameters:

org_name (str) – Name of the organization to change to

Return type:

None

async get_members() list[masterblaster.member.Member][source]#

Returns all members of the organization

Parameters:

None

Returns:

members – A list of all members in the organization

Return type:

List[Member]

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]

class masterblaster.Member(player: dict, email: str, name: str, playerId: str, role: int, addedAt: str, invitedAt)[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 – 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)[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 – 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