llama-index-readers-spotify


Namellama-index-readers-spotify JSON
Version 0.1.3 PyPI version JSON
download
home_page
Summaryllama-index readers spotify integration
upload_time2024-02-21 20:55:10
maintainerong
docs_urlNone
authorYour Name
requires_python>=3.8.1,<4.0
licenseMIT
keywords music spotify
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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](https://developer.spotify.com) 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".

```python
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](https://github.com/run-llama/llama_index/tree/main/llama_index) and/or subsequently used as a Tool in a [LangChain](https://github.com/hwchase17/langchain) Agent.

### LlamaIndex

```python
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 ?"
)
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "llama-index-readers-spotify",
    "maintainer": "ong",
    "docs_url": null,
    "requires_python": ">=3.8.1,<4.0",
    "maintainer_email": "",
    "keywords": "music,spotify",
    "author": "Your Name",
    "author_email": "you@example.com",
    "download_url": "https://files.pythonhosted.org/packages/79/d7/0e7bd4d8be3435bc0ff80d3df290e9e29f85aa3645340a249e4d91d5add5/llama_index_readers_spotify-0.1.3.tar.gz",
    "platform": null,
    "description": "# Spotify Loader\n\nThis loader reads your Spotify account and loads saved albums, tracks, or playlists into `Documents`.\n\nAs a prerequisite, you will need to register with [Spotify for Developers](https://developer.spotify.com) 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.\n\n`export SPOTIPY_CLIENT_ID='xxxxxxxxxxxxxxxxx'`\\\n`export SPOTIPY_CLIENT_SECRET='xxxxxxxxxxxxxxxxxx'`\\\n`export SPOTIPY_REDIRECT_URI='http://localhost:8080/redirect'`\n\n## Usage\n\nHere'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\".\n\n```python\nfrom llama_index import download_loader\n\nSpotifyReader = download_loader(\"SpotifyReader\")\n\nloader = SpotifyReader()\ndocuments = loader.load_data()\n```\n\n## Example\n\nThis loader is designed to be used as a way to load data into [LlamaIndex](https://github.com/run-llama/llama_index/tree/main/llama_index) and/or subsequently used as a Tool in a [LangChain](https://github.com/hwchase17/langchain) Agent.\n\n### LlamaIndex\n\n```python\nfrom llama_index import VectorStoreIndex, download_loader\n\nSpotifyReader = download_loader(\"SpotifyReader\")\n\nloader = SpotifyReader()\ndocuments = loader.load_data()\nindex = VectorStoreIndex.from_documents(documents)\nindex.query(\n    \"When are some other artists i might like based on what i listen to ?\"\n)\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "llama-index readers spotify integration",
    "version": "0.1.3",
    "project_urls": null,
    "split_keywords": [
        "music",
        "spotify"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b3c8927341ffc2d06b81f508ee71187feee1dda188369bc5616719d5953df94d",
                "md5": "3c1b7693537ff67ed6419b6f3bb29149",
                "sha256": "a7c84c98ed3f70d9f0571ccaaa567f3251ebc6e225b086df6277613df8e63a3e"
            },
            "downloads": -1,
            "filename": "llama_index_readers_spotify-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3c1b7693537ff67ed6419b6f3bb29149",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8.1,<4.0",
            "size": 3063,
            "upload_time": "2024-02-21T20:55:06",
            "upload_time_iso_8601": "2024-02-21T20:55:06.681141Z",
            "url": "https://files.pythonhosted.org/packages/b3/c8/927341ffc2d06b81f508ee71187feee1dda188369bc5616719d5953df94d/llama_index_readers_spotify-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "79d70e7bd4d8be3435bc0ff80d3df290e9e29f85aa3645340a249e4d91d5add5",
                "md5": "873e9899ccb9ae9b20aab83c582e8cf7",
                "sha256": "4821278adbe31f5c9814ed405808f745e2f7e048cee9bd6b4d52135ef6f72860"
            },
            "downloads": -1,
            "filename": "llama_index_readers_spotify-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "873e9899ccb9ae9b20aab83c582e8cf7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8.1,<4.0",
            "size": 2833,
            "upload_time": "2024-02-21T20:55:10",
            "upload_time_iso_8601": "2024-02-21T20:55:10.040311Z",
            "url": "https://files.pythonhosted.org/packages/79/d7/0e7bd4d8be3435bc0ff80d3df290e9e29f85aa3645340a249e4d91d5add5/llama_index_readers_spotify-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-21 20:55:10",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "llama-index-readers-spotify"
}
        
Elapsed time: 0.18876s