Spotify Loader
pip install llama-index-readers-spotify
This loader reads your Spotify account and loads saved albums, tracks, or playlists into Documents.
As a prerequisite, you will need to register with Spotify for Developers and create an app in order to get a client_id and a client_secret. You should then set a redirect_uri for the app (in the web dashboard under app settings). The redirect_uri does not need to be functional. You should then set the client_id, client_secret, and redirect_uri as environmental variables.
export SPOTIPY_CLIENT_ID='xxxxxxxxxxxxxxxxx'
export SPOTIPY_CLIENT_SECRET='xxxxxxxxxxxxxxxxxx'
export SPOTIPY_REDIRECT_URI='http://localhost:8080/redirect'
Usage
Here's an example usage of the SpotifyReader. It will retrieve your saved albums, unless an optional collection argument is passed. Acceptable arguments are "albums", "tracks", and "playlists".
from llama_index.readers.spotify import SpotifyReader
loader = SpotifyReader()
documents = loader.load_data()
Example
This loader is designed to be used as a way to load data into LlamaIndex.
LlamaIndex
from llama_index.core import VectorStoreIndex, download_loader
from llama_index.readers.spotify import SpotifyReader
loader = SpotifyReader()
documents = loader.load_data()
index = VectorStoreIndex.from_documents(documents)
index.query(
"When are some other artists i might like based on what i listen to ?"
)
Metadata
Release files for llama-index-readers-spotify 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| llama_index_readers_spotify-0.6.0.tar.gz | 4.2 kB | Without provenance | Details for llama_index_readers_spotify-0.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| llama_index_readers_spotify-0.6.0-py3-none-any.whl | Python 3 | none | any | Details for llama_index_readers_spotify-0.6.0-py3-none-any.whl |
Total release size: 8.1 kB
Release files / llama_index_readers_spotify-0.6.0.tar.gz
| Download URL | llama_index_readers_spotify-0.6.0.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8429cc9ac5515286517ece42625c41a84f6158c35f5a787734e60888290c9c8d
|
|
BLAKE2b-256 checksum How to use checksums |
e211207fa3ebf48145d3eda11c40c43203f26cfc31dc2be9d8ba2d981b1d2dcf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / llama_index_readers_spotify-0.6.0-py3-none-any.whl
| Download URL | llama_index_readers_spotify-0.6.0-py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
161a43412af67e7fff4274fb34b0117b98c8c33da02a717d11dfe0a0b1faedb4
|
|
BLAKE2b-256 checksum How to use checksums |
1ab1391302944286e824c9b99d90aa3f1f734def79e86595906dc48e4b247f23
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for llama-index-readers-spotify 0.6.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.