Extends the spotipy API client with randomized search.
Project description
Spotipy-random
Description
This package extends the already existing spotipy API client library with a randomized search functionallity. Both libraries are based on the official Spotify API.
Installation
This package can be installed through pip with the following command:
pip install spotipy-random
The spotipy package is also required and can be installed with:
pip install spotipy
Usage
To use this library first create a new spotipy client object including your personal Spotify API client_id and client_secret. Then the get_random method can be used to search for random tracks, albums and more. You can also specify search filters, although some filter will not work with each search type (Check details in the Spotify API documentation).
from spotipy import Spotfiy
from spotipy-random import get_random
spotify_client = spotipy.Spotify(auth_manager=SpotifyClientCredentials(
client_id="YOUR_APP_CLIENT_ID",
client_secret="YOUR_APP_CLIENT_SECRET"))
random_pop_song_json: str = get_random(spotify: spotify_client, type="track", genre="pop")
How it works
The randomization works by selecting a random letter to search for and randomly picking one of the result elements. The number of results can be changed with the limit parameter. The offset_min and offset_max parameters can optionally be used to influence the search result offset.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spotipy-random-0.0.3.tar.gz.
File metadata
- Download URL: spotipy-random-0.0.3.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f2e8c32d07e3287949b988f7577d080c46fa71e08e72a9c30179bdfa0cc1154
|
|
| MD5 |
7e11ae14628e2fe5d62c20b337d758f8
|
|
| BLAKE2b-256 |
f4773b5d853ecd488224344c7cb7269b61fa44aaa4b99c8c55ff1bc7374fc9eb
|
File details
Details for the file spotipy_random-0.0.3-py3-none-any.whl.
File metadata
- Download URL: spotipy_random-0.0.3-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02453b738924386d329c6342f6735cfb8801b04673a30f47305b49aef84fd5b3
|
|
| MD5 |
cf62be160cc1f780d52a6689561e9695
|
|
| BLAKE2b-256 |
b3d1f21ea6048f378acc3204fc5ced1a11e2d418ae4aa3d137e04fd81a52ec47
|