Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llama_index_readers_spotify-0.4.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llama_index_readers_spotify-0.4.1-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file llama_index_readers_spotify-0.4.1.tar.gz.

File metadata

File hashes

Hashes for llama_index_readers_spotify-0.4.1.tar.gz
Algorithm Hash digest
SHA256 c9290b23bde8949a5f3de92ea68fe1af43096389b4c06584c29abc3d779e0d77
MD5 e7ff6fcaf3d13186d4292a19062ac621
BLAKE2b-256 b422e379afa814bd3bc1f7bf7e9b133f541d97c13fa67c4e8143f1fc2ad12a83

See more details on using hashes here.

File details

Details for the file llama_index_readers_spotify-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_readers_spotify-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cd7180723eea5d9af107c8cbd25c9df9de39c20a696a3f2239048937ed58a8e1
MD5 305a522fa640e4652f261c1d5973fcd3
BLAKE2b-256 d6e082cf6b32f3cca04fc351ad07cbeb3349d8385ee6c89f06c41c00feff296a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page