Resources module¶
Module to implement the various types of resources that can be found in the API.
- class deezer.resources.Album(client, json)¶
To work with an album object.
All the fields documented on Deezer are accessible by as class attributes.
- rate(note: int) bool ¶
Rate the album with the given note.
- Parameters
note – rating to give.
- Returns
boolean, whether the album was rated
- class deezer.resources.Artist(client, json)¶
To access an artist object.
All the fields documented on Deezer are accessible by as class attributes.
Get a list of related artists.
- Returns
list of
Artist
instances
Iterate related artists.
- Returns
iterator of
Artist
instances
- class deezer.resources.Chart(client, json)¶
To access an chart object.
All the fields documented on Deezer are accessible by as class attributes.
- class deezer.resources.Comment(client, json)¶
To access an comment object.
All the fields documented on Deezer are accessible by as class attributes.
- class deezer.resources.Episode(client, json)¶
To access an episode object.
All the fields documented on Deezer are accessible by as class attributes.
- class deezer.resources.Genre(client, json)¶
To access an genre object.
All the fields documented on Deezer are accessible by as class attributes.
- class deezer.resources.Playlist(client, json)¶
To access an playlist object.
All the fields documented on Deezer are accessible by as class attributes.
- class deezer.resources.Podcast(client, json)¶
To access an podcast object.
All the fields documented on Deezer are accessible by as class attributes.
- class deezer.resources.Radio(client, json)¶
To access an radio object.
All the fields documented on Deezer are accessible by as class attributes.
- class deezer.resources.Resource(client, json)¶
Base class for any resource.
It is mainly responsible of passing a reference to the client to this class when instantiated, and transmit the json data into attributes
- as_dict()¶
Convert resource to dictionary
- get_relation(relation, **kwargs)¶
Generic method to load the relation from any resource.
Query the client with the object’s known parameters and try to retrieve the provided relation type. This is not meant to be used directly by a client, it’s more a helper method for the child objects.
- iter_relation(relation, **kwargs)¶
Generic method to iterate relation from any resource.
Query the client with the object’s known parameters and try to retrieve the provided relation type. This is not meant to be used directly by a client, it’s more a helper method for the child objects.
- class deezer.resources.Track(client, json)¶
To access an track object.
All the fields documented on Deezer are accessible by as class attributes.
- class deezer.resources.User(client, json)¶
To access an user object.
All the fields documented on Deezer are accessible by as class attributes.