Resources

Objects that represent an API resource are locked away in here. Things such as gamer profile, games and clips.

class xbox.GamerProfile(xuid, settings, user_data)

Represents an xbox live user.

Variables:
  • xuid (string) – xuid of user
  • gamertag (string) – gamertag of user
  • gamerscore (string) – gamerscore of user
  • gamerpic (string) – url for gamerpic of user
clips()

Gets the latest clips made by this user

Returns:Iterator of Clip instances
classmethod from_gamertag(gamertag)

Instantiates an instance of GamerProfile from a gamertag

Parameters:gamertag – Gamertag to look up
Raises:GamertagNotFound
Returns:GamerProfile instance
classmethod from_xuid(xuid)

Instantiates an instance of GamerProfile from an xuid

Parameters:xuid – Xuid to look up
Raises:GamertagNotFound
Returns:GamerProfile instance
class xbox.Clip(user, clip_data)

Represents a single game clip.

Variables:
  • user – User that made the clip
  • clip_id (string) – Unique id of the clip
  • scid (string) – Unique SCID of the clip
  • duration (string) – Duration, in seconds, of the clip
  • name (string) – Name of the clip. Can be ''
  • saved (bool) – Whether the user has saved the clip. Clips that aren’t saved eventually expire
  • state (string) –
  • views (string) – Number of views the clip has had
  • rating (string) – Clip rating
  • ratings (string) – Number of ratings the clip has received
  • caption (string) – User-defined clip caption
  • thumbnails (dict) – Thumbnail URLs for the clip
  • recorded (datetime) – Date and time clip was made
  • media_url (string) – Video clip URL
classmethod get(xuid, scid, clip_id)

Retrieves a specific game clips

Parameters:
  • xuid – xuid of an xbox live user
  • scid – scid of a clip
  • clip_id – id of a clip
Returns:

Clip instance

classmethod saved_from_user(user[, include_pending=False])

Retrieves all ‘saved’ clips for a specific user, returning an iterator.

Parameters:
  • userGamerProfile instance
  • include_pending (bool) – whether to ignore clips that are not yet uploaded. These clips will have thumbnails and media_url set to None
Returns:

Iterator of Clip instances

classmethod latest_from_user(user[, include_pending=False])

Retrieves a user’s gameclips, excluding any that are pending upload.

Parameters:
  • userGamerProfile instance
  • include_pending (bool) – whether to ignore clips that are not yet uploaded. These clips will have thumbnails and media_url set to None
Returns:

Iterator of Clip instances