Library

Inheritance diagram of musify.libraries.remote.spotify.library

Implements a RemoteLibrary for Spotify.

Classes:

SpotifyLibrary(api[, playlist_filter])

Represents a Spotify library.

class musify.libraries.remote.spotify.library.SpotifyLibrary(api, playlist_filter=())

Bases: RemoteLibrary[SpotifyAPI, SpotifyPlaylist, SpotifyTrack, SpotifyAlbum, SpotifyArtist]

Represents a Spotify library. Provides various methods for manipulating tracks and playlists across an entire Spotify library collection.

Methods:

enrich_tracks([features, analysis, albums, ...])

Enriches the features, analysis, albums, and/or artists data for currently loaded tracks.

enrich_saved_albums()

Extends the tracks data for currently loaded albums, getting all available tracks data for each album

enrich_saved_artists([tracks, types])

Gets all albums for current loaded following artists.

enrich_tracks(features=False, analysis=False, albums=False, artists=False)

Enriches the features, analysis, albums, and/or artists data for currently loaded tracks.

Parameters:
  • features (bool (default: False)) – Load all audio features (e.g. BPM, tempo, key etc.)

  • analysis (bool (default: False)) – Load all audio analyses (technical audio data). WARNING: can be very slow as calls to this endpoint cannot be batched i.e. one call per track.

  • albums (bool (default: False)) – Reload albums for all tracks, adding extra album data e.g. genres, popularity

  • artists (bool (default: False)) – Reload artists for all tracks, adding extra artist data e.g. genres, popularity, followers

Return type:

None

enrich_saved_albums()

Extends the tracks data for currently loaded albums, getting all available tracks data for each album

Return type:

None

enrich_saved_artists(tracks=False, types=())

Gets all albums for current loaded following artists.

Parameters:
  • tracks (bool (default: False)) – When True, also get all tracks for each album.

  • types (Collection[str] (default: ())) – Provide a list of albums types to get to limit the types of albums loaded. Select from {"album", "single", "compilation", "appears_on"}.

Return type:

None