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.

get_tracks(**kwargs)

Get a list of album’s tracks.

Returns:list of Track instances
iter_tracks(**kwargs)

Iterate album’s tracks.

Returns:list of Track instances
class deezer.resources.Artist(client, json)

To access an artist.

get_albums(**kwargs)

Get a list of artist’s albums.

Returns:list of Album instances
get_radio(**kwargs)
Returns:list of Track instances

Get a list of related artists.

Returns:list of Artist instances
get_top(**kwargs)

Get the top tracks of an artist.

Returns:list of Track instances
iter_albums(**kwargs)

Iterate artist’s albums.

Returns:list of Album instances

Iterate related artists.

Returns:list of Artist instances
class deezer.resources.Chart(client, json)

To access charts.

get_albums(**kwargs)
Returns:the Album instance
get_artists(**kwargs)
Returns:list of Artist instances
get_playlists(**kwargs)
Returns:list of Playlist instances
get_tracks(**kwargs)
Returns:list of Track instances
iter_albums(**kwargs)

Iterate artist’s albums.

Returns:list of Album instances
iter_artists(**kwargs)

Iterate artists for a genre.

Returns:list of Artist instances
iter_playlists(**kwargs)

Iterate playlist for a genre.

Returns:list of Playlist instances
iter_tracks(**kwargs)

Iterate tracks in the radio

Returns:list of Track instances
class deezer.resources.Comment(client, json)

To access a comment.

class deezer.resources.Genre(client, json)

To access a genre.

get_artists(**kwargs)

Get all artists for a genre.

Returns:list of Artist instances
get_radios(**kwargs)

Get all radios for a genre.

Returns:list of Radio instances
iter_artists(**kwargs)

Iterate artists for a genre.

Returns:list of Artist instances
iter_radios(**kwargs)

Iterate radios for a genre.

Returns:list of Radio instances
class deezer.resources.Playlist(client, json)

To access a playlist.

class deezer.resources.Radio(client, json)

To access a radio.

get_tracks(**kwargs)

Get first 40 tracks in the radio

Returns:list of Track instances
iter_tracks(**kwargs)

Iterate tracks in the radio

Returns:list of Track instances
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 resource
Raises: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.

get_album()
Returns:the Album instance
class deezer.resources.User(client, json)

To access a user.

get_albums(**kwargs)

Get user’s favorite albums.

Returns:list of Album instances
get_artists(**kwargs)

Get user’s favorite artists.

Returns:list of Artist instances
get_playlists(**kwargs)

Get user’s public playlists.

Returns:list of Playlist instances
get_tracks(**kwargs)

Get user’s favorite tracks.

Returns:list of Track instances
iter_albums(**kwargs)

Iterate user’s favorite albums.

Returns:list of Album instances
iter_artists(**kwargs)

Iterate user’s favorite artists.

Returns:list of Artist instances
iter_playlists(**kwargs)

Iterate user’s public playlists.

Returns:list of Playlist instances
iter_tracks(**kwargs)

Iterate user’s favorite tracks.

Returns:list of Track instances