masterblaster

Submodules

Package Contents

Classes

Header

A MutableMapping is a generic container for associating

Member

Image

Header

A MutableMapping is a generic container for associating

MasterBlaster

Player

Member

Image

GameAccount

GameAccount

Player

Attributes

__title__

__author__

__license__

__copyright__

__version__

BASE

masterblaster.__title__ = 'masterblaster'
masterblaster.__author__ = 'Øyvind Nohr'
masterblaster.__license__ = 'MIT'
masterblaster.__version__ = '0.0.5'
class masterblaster.Header[source]

Bases: collections.abc.MutableMapping

A MutableMapping is a generic container for associating key/value pairs.

This class provides concrete generic implementations of all methods except for __getitem__, __setitem__, __delitem__, __iter__, and __len__.

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

__getitem__(key: str) Any[source]
__getattr__(key: str) Any[source]
__setitem__(key: str, __v: Any) None[source]
__delitem__(key: str) None[source]
__len__() int[source]
__iter__() Iterator[Any][source]
__str__() str[source]

Return str(self).

__repr__() str[source]

Return repr(self).

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

Return str(self).

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

Bases: collections.abc.MutableMapping

A MutableMapping is a generic container for associating key/value pairs.

This class provides concrete generic implementations of all methods except for __getitem__, __setitem__, __delitem__, __iter__, and __len__.

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

__getitem__(key: str) Any[source]
__getattr__(key: str) Any[source]
__setitem__(key: str, __v: Any) None[source]
__delitem__(key: str) None[source]
__len__() int[source]
__iter__() Iterator[Any][source]
__str__() str[source]

Return str(self).

__repr__() str[source]

Return repr(self).

masterblaster.BASE = 'https://app.masterblaster.gg/api'
class masterblaster.MasterBlaster(access_token: Optional[str], org_name: str)[source]
async __aenter__() MasterBlaster[source]
async __aexit__(exc_type, exc_value, traceback) None[source]
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 MasterBlaster instance

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

  • org_name (str) – The name of the organization

Returns:

A new MasterBlaster instance

Return type:

MasterBlaster

async _setup(org_name: str) MasterBlaster[source]
async get_org(org_id: str) dict[str, str | dict][source]

Returns the organization for the given organization id

Parameters:

(str) (org_id) –

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 _set_org_id(org_name: str) None[source]
async _set_org_members() None[source]
async _set_org_images() None[source]
async _update_members() None[source]
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 _update_images() None[source]
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.Player(id: str, nickName: str, avatarUrl: str, registered: str, isProfileComplete: bool, gameAccounts: list[masterblaster.gameaccount.GameAccount])[source]
class masterblaster.Member(player: dict, email: str, name: str, playerId: str, role: int, addedAt: str, invitedAt)[source]
__str__() str[source]

Return str(self).

class masterblaster.Image(imageType: int, imageId: str, originalImageId: str)[source]
class masterblaster.GameAccount(id: str, nick: str, avatarUrl: str, gameId: str, isConnected: bool, connectedAt)[source]
class masterblaster.GameAccount(id: str, nick: str, avatarUrl: str, gameId: str, isConnected: bool, connectedAt)[source]
class masterblaster.Player(id: str, nickName: str, avatarUrl: str, registered: str, isProfileComplete: bool, gameAccounts: list[masterblaster.gameaccount.GameAccount])[source]