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.

get_artist()

Get the artist of the Album.

Returns

the Artist of the Album

get_tracks(**kwargs)

Get a list of album’s tracks.

Returns

list of Track instances

iter_tracks(**kwargs)

Iterate album’s tracks.

Returns

iterator of Track instances

class deezer.resources.Artist(client, json)

To access an artist object.

All the fields documented on Deezer are accessible by as class attributes.

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

iterator of Album 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.

get_albums(**kwargs)
Returns

list of Album instances

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

iterator of Album instances

iter_artists(**kwargs)

Iterate artists for a genre.

Returns

iterator of Artist instances

iter_playlists(**kwargs)

Iterate playlist for a genre.

Returns

iterator of Playlist instances

iter_tracks(**kwargs)

Iterate tracks in the radio

Returns

iterator of Track instances

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.

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

iterator of Artist instances

iter_radios(**kwargs)

Iterate radios for a genre.

Returns

iterator of Radio instances

class deezer.resources.Playlist(client, json)

To access an playlist object.

All the fields documented on Deezer are accessible by as class attributes.

get_fans(**kwargs)

Get fans from a playlist.

Returns

list of User instances

get_tracks(**kwargs)

Get tracks from a playlist.

Returns

list of Track instances

iter_fans(**kwargs)

Iterate over fans of a playlist.

Returns

iterator of User instances

iter_tracks(**kwargs)

Iterate over a playlist tracks.

Returns

iterator of Track instances

class deezer.resources.Podcast(client, json)

To access an podcast object.

All the fields documented on Deezer are accessible by as class attributes.

get_episodes(**kwargs)

Get episodes from a podcast

Returns

list of Episode instances

iter_episodes(**kwargs)

Iterate over episodes of a podcast

Returns

list of Episode instances

class deezer.resources.Radio(client, json)

To access an radio object.

All the fields documented on Deezer are accessible by as class attributes.

get_tracks(**kwargs)

Get first 40 tracks in the radio

Returns

list of Track instances

iter_tracks(**kwargs)

Iterate tracks in the radio

Returns

iterator 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_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.

get_album()
Returns

the Album instance

get_artist()

Get the artist of the Track.

Returns

the Artist of the Album

class deezer.resources.User(client, json)

To access an user object.

All the fields documented on Deezer are accessible by as class attributes.

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

iterator of Album instances

iter_artists(**kwargs)

Iterate user’s favorite artists.

Returns

iterator of Artist instances

iter_playlists(**kwargs)

Iterate user’s public playlists.

Returns

iterator of Playlist instances

iter_tracks(**kwargs)

Iterate user’s favorite tracks.

Returns

iterator of Track instances