spotifywebapipython.models.playlist

Spotify Web API Playlist object.

Playlist(root: dict = None)

Initializes a new instance of the class.

Arguments:
  • root (dict): Spotify Web API JSON response in dictionary format, used to load object attributes; otherwise, None to not load attributes.

Information about the followers of the playlist.

The tracks of the playlist.

This is a PlaylistPage object, meaning only 50 tracks max are listed per request.

def GetTracks(self) -> list[spotifywebapipython.models.track.Track]:

Gets a list of all tracks contained in the underlying Items list.

This is a convenience method so one does not have to loop through the Items array of PlaylistPage objects to get the list of tracks.

def ToDictionary(self) -> dict:

Returns a dictionary representation of the class.

def ToString(self) -> str:

Returns a displayable string representation of the class.