llama-index readers spotify integration
Project description
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 ?"
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llama_index_readers_spotify-0.5.0.tar.gz.
File metadata
- Download URL: llama_index_readers_spotify-0.5.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56f00a26c42e1d8eb66160dbd41646dd492490df2177a61083e54500d96a8600
|
|
| MD5 |
112209cf18afcc063b05f5111350eaac
|
|
| BLAKE2b-256 |
447be4496482f5c398533a9e614a59f871cd799f97236b623cb1d4dd5f707fc3
|
File details
Details for the file llama_index_readers_spotify-0.5.0-py3-none-any.whl.
File metadata
- Download URL: llama_index_readers_spotify-0.5.0-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c25a17728188b2d64c55cbe19d3d810d4e4b5fca3eb43d046e0cb2bbb434f092
|
|
| MD5 |
27ce01ba11eb204f26c3735e954952d9
|
|
| BLAKE2b-256 |
244f1c2436bc31e0590e92ea26271b14e4f5faa6f3996e72f8e9b103d38cc648
|