Library
Implements a RemoteLibrary
for Spotify.
Classes:
|
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/orartists
data for currently loaded tracks.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.
- async enrich_tracks(features=False, analysis=False, albums=False, artists=False)
Enriches the
features
,analysis
,albums
, and/orartists
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, popularityartists (
bool
(default:False
)) – Reload artists for all tracks, adding extra artist data e.g. genres, popularity, followers
- Return type:
None
- async enrich_saved_albums()
Extends the tracks data for currently loaded albums, getting all available tracks data for each album
- Return type:
None
- async 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