pytwitcherapi.models.User

class pytwitcherapi.models.User(usertype, name, logo, twitchid, displayname, bio)[source]

Bases: object

A user on twitch.tv

__init__(usertype, name, logo, twitchid, displayname, bio)[source]

Initialize a new user

Parameters:
  • usertype (str) – the user type on twitch, e.g. "user"
  • name (str) – the username
  • logo (str) – the link to the logo
  • twitchid (int) – the internal twitch id
  • displayname (str) – the name diplayed by the interface
  • bio (str) – the user bio
Raises:

None

Methods

__init__(usertype, name, logo, twitchid, ...) Initialize a new user
wrap_get_user(response) Wrap the response from getting a user into an instance
wrap_json(json) Create a User instance for the given json
classmethod wrap_get_user(response)[source]

Wrap the response from getting a user into an instance and return it

Parameters:response (requests.Response) – The response from getting a user
Returns:the new user instance
Return type:list of User
Raises:None
classmethod wrap_json(json)[source]

Create a User instance for the given json

Parameters:json (dict | None) – the dict with the information of the user
Returns:the new user instance
Return type:User
Raises:None
usertype = None

the user type on twitch, e.g. "user"

name = None

the username

link to the logo

twitchid = None

internal twitch id

displayname = None

name displayed by the interface

bio = None

the user bio