Registry / data / spotify-to-sqlite

spotify-to-sqlite

JSON →
library0.2.1pypypi✓ verified 84d ago

Converts a Spotify export ZIP file into a SQLite database. Current version 0.2.1, released Jun 2023. Low activity, maintained as needed.

pip install spotify-to-sqlite
INSTALL
IMPORT
SIG · SPOTIFY-TO-SQLITE
S
spotify-to-sqlite
datapythonv0.2.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

spotify_to_sqlite
import spotify_to_sqlite
Top-level module; no common wrong import.

Basic usage via subprocess; CLI converts export to database.

# Convert a Spotify export zip to SQLite db_path = 'spotify.db' # Run CLI command: spotify-to-sqlite convert my_spotify_data.zip spotify.db import subprocess subprocess.run(['spotify-to-sqlite', 'convert', 'my_spotify_data.zip', db_path]) # Or use with audio features: # spotify-to-sqlite convert my_spotify_data.zip spotify.db --audio-features
spotify-to-sqlite --version
Debug
Known issues
breakingThe default command changed from `spotify-to-sqlite my_spotify_data.zip spotify.db` to `spotify-to-sqlite convert my_spotify_data.zip spotify.db` in v0.2.
fix
Use the `convert` subcommand: `spotify-to-sqlite convert <input> <output>`
affects: 0.2+
deprecatedThe `--recreate` flag in v0.1.1+ replaces the old default of overwriting the database. Not a breaking change but behavior differs from v0.1.
fix
To overwrite an existing database, use `--recreate`.
affects: >=0.1.1
gotchaAudio features require Spotify API credentials (SPOTIPY_CLIENT_ID, SPOTIPY_CLIENT_SECRET). Without them, `--audio-features` fails silently or errors.
fix
Set environment variables SPOTIPY_CLIENT_ID and SPOTIPY_CLIENT_SECRET before running with `--audio-features`.
affects: >=0.1.1
Errors
Common errors & fixes
Usage: spotify-to-sqlite [OPTIONS] COMMAND [ARGS]... Try 'spotify-to-sqlite --help' for help. Error: No such command 'convert'.
User has an old version (<0.2) and tries `convert` subcommand.
fix
Upgrade to spotify-to-sqlite>=0.2 with `pip install --upgrade spotify-to-sqlite`.
TypeError: 'NoneType' object is not subscriptable
Missing or malformed ZIP file; often happens when file path is incorrect.
fix
Verify the ZIP file path and ensure it's a valid Spotify data export.
spotipy.oauth2.SpotifyOauthError: You need to set your Spotify API credentials.
Missing SPOTIPY_CLIENT_ID or SPOTIPY_CLIENT_SECRET environment variables when using --audio-features.
fix
Set environment variables: SPOTIPY_CLIENT_ID='your_id' SPOTIPY_CLIENT_SECRET='your_secret'.
Upgrade
Version history
0.2.1latest on PyPI · released Nov 5, 2022
Audit
Dependencies
clickrequiredCLI framework
sqlite_utilsrequiredSQLite database creation
spotipyrequiredSpotify Web API calls
Agent activity
9 hits · last 30 days
node
8
OpenAI (training)
1
Resources
spotify-to-sqlite — pip install spotify-to-sqlite · libregistry