Client for interacting with the Spotify API
Project description
spotify-client
Client for interacting with the Spotify API
Usage
First install the package with pip:
pip install spotify-client
Then import the client for usage in your application:
from spotify_client import SpotifyClient
SPOTIFY_CLIENT_ID = 'client_id_from_spotify'
SPOTIFY_SECRET_KEY = 'secret_key_from_spotify'
client = SpotifyClient(SPOTIFY_CLIENT_ID, SPOTIFY_SECRET_KEY, identifier='test-spotify-client')
You'll need to generate your client ID and secret keys for authenticating with Spotify from their API console. You can find the steps for doing that in the Spotify documentation.
The client will make a request to generate the access_token the first time it makes a call to the API. It will then cache the access token as an instance variable, to use in future requests by that client instance. This avoids the overhead of having to make a request for the access token on each request to the API.
You can optionally pass an identifier to the constructor. This will be used in logging messages by the client to uniquely identify logs for the client instance.
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file spotify-client-0.0.3.tar.gz
.
File metadata
- Download URL: spotify-client-0.0.3.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fbd72d5f44ffa8c062ecabc1472cff629a2c5c9eafe2c9ba3a6a8a15fec992fe |
|
MD5 | d9072b956f0e2bbb1ea0af48e2a963c5 |
|
BLAKE2b-256 | fe80226b5ae9d7293f99885b0bc1d53c4f7938a41b2fa46f2fefd8da81b86ce8 |
File details
Details for the file spotify_client-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: spotify_client-0.0.3-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3a799290d95d0682e84fa4ebfa8d99f06f98530fc877107a4375a778c397219 |
|
MD5 | f2ef43eed6a6976511726c335333cb65 |
|
BLAKE2b-256 | 9a63a73d808466384e2b343583b08dad859e8283db572f80e1481a1f9f5b34aa |