llama-index readers spotify integration
Project description
Spotify Loader
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 import download_loader
SpotifyReader = download_loader("SpotifyReader")
loader = SpotifyReader()
documents = loader.load_data()
Example
This loader is designed to be used as a way to load data into LlamaIndex and/or subsequently used as a Tool in a LangChain Agent.
LlamaIndex
from llama_index import VectorStoreIndex, download_loader
SpotifyReader = download_loader("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
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
Hashes for llama_index_readers_spotify-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4c4e90e30fc4885e243e698a5ba118bdb5b075897326922c1d616994e4acf95 |
|
MD5 | 908b636b559b3fcedda709bd82aa27e2 |
|
BLAKE2b-256 | c39c4b698369f0281a53a32316f38c51854830b59e181c5dffa654018feb74a2 |
Hashes for llama_index_readers_spotify-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c17474db7a07b07bab48e61c9dbc7dc7744b50148c6d414e1b9cf000b702cfd |
|
MD5 | b3f176ad0ef655b647b7e665b0624353 |
|
BLAKE2b-256 | 7679f108546d968783c0387792f34921340b01fb8af88df8108def6445e9b5cd |