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.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ca027024b2f549d3c17cb26ee101b3de6b969cbb686bfa27a82c0a3554d7022 |
|
MD5 | 8b58e2c21a3a901dfc03a4d1cf7efd40 |
|
BLAKE2b-256 | 2e9195dc4277b2fa9dcafadb85ba99c22cb69591b9308f00cdc90c6aff271612 |
Hashes for llama_index_readers_spotify-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ac63ad5781288ca465072d6a2186676d4bf1ff401fa4ecd1d358eb021c941cb |
|
MD5 | 3c0ec6f070e56388f260c242774a2cee |
|
BLAKE2b-256 | ffb957ae3995931a7cadb07bcaad03b3d6b761812a4795f1d923470afab7177d |