Resources module¶
Module to implement the various types of resources that can be found in the API.
-
class
deezer.resources.
Album
(client, json)¶ To access an album resource.
-
class
deezer.resources.
Artist
(client, json)¶ To access an artist.
Get a list of related artists.
Returns: list of Artist
instances
Iterate related artists.
Returns: list of Artist
instances
-
class
deezer.resources.
Chart
(client, json)¶ To access charts.
-
class
deezer.resources.
Comment
(client, json)¶ To access a comment.
-
class
deezer.resources.
Genre
(client, json)¶ To access a genre.
-
class
deezer.resources.
Playlist
(client, json)¶ To access a playlist.
-
class
deezer.resources.
Radio
(client, json)¶ To access a radio.
-
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
-
asdict
()¶ Convert resource to dictionary
-
get_artist
()¶ Returns: the Artist
of the resourceRaises: TypeError – if the object is not album or track
-
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 a track.
-
class
deezer.resources.
User
(client, json)¶ To access a user.