"""Client wrapper for a Spotify API connection.""" import spotipy from spotipy.oauth2 import SpotifyClientCredentials from product_staging import config def create_spotify_client() -> spotipy.Spotify: """Create and return a Spotify client using client credentials flow.""" return spotipy.Spotify( auth_manager=SpotifyClientCredentials( client_id=config.SPOTIFY_API_CLIENT_ID, client_secret=config.SPOTIFY_API_CLIENT_SECRET, ) )