🎷 Deez

Module: deez.py

Provides methods for searching and fetching music metadata by using Deezer API client.

class Deezer

A wrapper around the Deezer API client for searching and fetching music metadata.

search(query: str, stype: Literal['track', 'album'] = 'track', limit: int = 5) List[dict]

Searches for tracks or albums on Deezer and returns a list of results.

Parameters:
  • query – The search query string (e.g. “Apples - Rocco”).

  • stype – The type of content to search for. Must be “track” or “album”. Defaults to “track”.

  • limit – The maximum number of results to return. Must be at least 1. Defaults to 5.

Returns:

A dict containing id, title, and artists which represents the Deezer ID, title, and contributing artist names respectively.

Raises:
get_track(id: int) TrackMetadata

Fetches full metadata for a track by its Deezer ID.

Parameters:

id – The unique Deezer ID of the track.

Returns:

A TrackMetadata instance filled with the track’s details.

get_album(id: int, shuffle: bool = False) AlbumMetadata

Fetches full metadata for an album by its Deezer ID.

Parameters:
  • id – The unique Deezer ID of the album.

  • shuffle – If True, the track listing will be returned in a random order. Defaults to False.

Returns:

An AlbumMetadata instance filled with the album’s details.