Spotixplore

raw JSON →
0.2.0 verified Sat May 09 auth: no python deprecated

A Python library to explore Spotify tracks features and recommendations from a given playlist. Version 0.2.0, pre-release, unmaintained since 2023.

pip install spotixplore==0.2.0
error ModuleNotFoundError: No module named 'spotixplore'
cause Library not installed or name mismatch (typo).
fix
Run 'pip install spotixplore==0.2.0' and ensure correct import: from spotixplore import Spotixplore
error AttributeError: module 'spotixplore' has no attribute 'Spotixplore'
cause Importing from wrong module path.
fix
Use: from spotixplore import Spotixplore
error spotipy.oauth2.SpotifyOauthError: No client_id or client_secret set
cause Missing Spotify API credentials.
fix
Set environment variables SPOTIPY_CLIENT_ID and SPOTIPY_CLIENT_SECRET.
deprecated The library is no longer maintained; may break with future Spotify API changes.
fix Consider migrating to direct use of spotipy or another maintained library.
gotcha Requires Spotify API credentials; SPOTIPY_CLIENT_ID and SPOTIPY_CLIENT_SECRET must be set.
fix Set environment variables or pass them explicitly via auth_manager.
gotcha Does not support pagination for playlists with many tracks; may return incomplete results.
fix Use spotipy directly to handle pagination.

Initialize with authenticated Spotify client and fetch features for a playlist.

import spotipy
from spotixplore import Spotixplore
from spotipy.oauth2 import SpotifyClientCredentials

client_id = os.environ.get('SPOTIPY_CLIENT_ID', '')
client_secret = os.environ.get('SPOTIPY_CLIENT_SECRET', '')
auth_manager = SpotifyClientCredentials(client_id=client_id, client_secret=client_secret)
sp = spotipy.Spotify(auth_manager=auth_manager)

pl = Spotixplore(sp)
# Replace with a valid playlist ID
df = pl.get_playlist_features('37i9dQZF1DXcBWIGoYBM5M')
print(df.head())