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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb47cb69d5b8c0d70e58a136850efbb2e4bb3002faa0b9711088f1867abdea66 |
|
MD5 | 19be4250ef73433bc74b4ceb7c6ad991 |
|
BLAKE2b-256 | d60c49df23c75a42be20fffa3e0df07d2388c592d605fc7999560472fa35bb55 |
Hashes for llama_index_readers_spotify-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8447659ddd97639846f5f427037ea14250da8c4f372d221565fbe7086bec9dd8 |
|
MD5 | 61ffba0b61b94d8af3376788c835b9cb |
|
BLAKE2b-256 | 5bc38d0d5f588b79f34989a5a81ae256cd9ef5e35fbb7e164ff246d6042d549b |