Documentation for Dotify
¤
A subclass of spotipy.Spotify
, which provides a more object oriented interface.
Examples:
>>> from dotify import Dotify
... with Dotify(spotify_client, spotify_secret):
... for result in Track.search(query):
... ...
__init__(self, client_id=None, client_secret=None)
special
¤
Create a Dotify
instance.
If no client_id
and/or client_secret
are provided, an environment variable look up is performed for the names SPOTIFY_ID
and/or SPOTIFY_SECRET
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
client_id | Optional[str] | your Spotify API client ID. Defaults to None | None |
client_secret | Optional[str] | your Spotify API client secret. Defaults to None | None |
search(self, model_type, query, limit=1)
¤
Perform a Spotify search given a query
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_type | str | One of 'artist', 'album', 'track', 'playlist' | required |
query | ~AnyStr | the search | required |
limit | Optional[int] | the number of items to return. Defaults to 1. | 1 |
Returns:
Type | Description |
---|---|
List[Dict[~AnyStr, Any]] | List[Dict[AnyStr, Any]]: A list containing the search results |