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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4821278adbe31f5c9814ed405808f745e2f7e048cee9bd6b4d52135ef6f72860 |
|
MD5 | 873e9899ccb9ae9b20aab83c582e8cf7 |
|
BLAKE2b-256 | 79d70e7bd4d8be3435bc0ff80d3df290e9e29f85aa3645340a249e4d91d5add5 |
Hashes for llama_index_readers_spotify-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7c84c98ed3f70d9f0571ccaaa567f3251ebc6e225b086df6277613df8e63a3e |
|
MD5 | 3c1b7693537ff67ed6419b6f3bb29149 |
|
BLAKE2b-256 | b3c8927341ffc2d06b81f508ee71187feee1dda188369bc5616719d5953df94d |