Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

spotipy-random

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spotipy-random

Extends the spotipy API client with randomized search.

  • 0.0.3
  • PyPI
  • Socket score

Maintainers
1

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.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc