SpotipyTUI

raw JSON →
1.0.5 verified Sat May 09 auth: no python

A text-based user interface (TUI) for controlling the Spotify desktop client, built on spotipy. Version 1.0.5; no recent activity, last release 2023. Low cadence.

pip install spotipy-tui
error SpotifyClientError: 401 - Unauthorized
cause Missing or invalid Spotify API credentials (SPOTIPY_CLIENT_ID, SPOTIPY_CLIENT_SECRET).
fix
Set environment variables SPOTIPY_CLIENT_ID and SPOTIPY_CLIENT_SECRET from Spotify Developer Dashboard.
error ModuleNotFoundError: No module named 'spotipy_tui'
cause Package not installed; name is hyphenated but import uses underscore.
fix
Run 'pip install spotipy-tui' then import as 'from spotipy_tui import SpotipyTUI'.
gotcha Requires the Spotify desktop client running. The TUI controls the local client, not the web API.
fix Ensure Spotify desktop app is open and playing on the same machine.
deprecated Uses spotipy with the 'user-modify-playback-state' scope, which may be deprecated. Some endpoints may stop working.
fix Check spotipy docs for updated scopes; manually set scope in scope parameter.

Initialize and run the TUI using Spotify credentials from environment variables.

from spotipy_tui import SpotipyTUI
import os
client_id = os.environ.get('SPOTIPY_CLIENT_ID', '')
client_secret = os.environ.get('SPOTIPY_CLIENT_SECRET', '')
redirect_uri = 'http://localhost:8888/callback'
tui = SpotipyTUI(client_id=client_id, client_secret=client_secret, redirect_uri=redirect_uri)
tui.run()