Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@send_and_process(single(SimpleEpisodePaging))
@maximise_limit(50)
def show_episodes(
self,
show_id: str,
market: str = None,
limit: int = 20,
offset: int = 0
) -> SimpleEpisodePaging:
"""
Get episodes of a show.
Parameters
----------
show_id
show ID
market
@send_and_process(single(FullArtistCursorPaging, from_item='artists'))
@maximise_limit(50)
def followed_artists(
self,
limit: int = 20,
after: str = None
) -> FullArtistCursorPaging:
"""
Get artists followed by the current user.
Parameters
----------
limit
the number of items to return (1..50)
after
the last artist ID retrieved from the previous request
"""
@send_and_process(single(SavedShowPaging))
@maximise_limit(50)
def saved_shows(
self,
market: str = None,
limit: int = 20,
offset: int = 0
) -> SavedShowPaging:
"""
Get the shows saved in the current user's library.
Parameters
----------
market
an ISO 3166-1 alpha-2 country code or 'from_token'
limit
the number of items to return (1..50)
@send_and_process(single(Recommendations))
@maximise_limit(100)
def recommendations(
self,
artist_ids: list = None,
genres: list = None,
track_ids: list = None,
limit: int = 20,
market: str = None,
**attributes
) -> Recommendations:
"""
Get a list of recommended tracks for seeds.
Up to 5 seed values may be provided as artists, genres and tracks.
Parameters
@send_and_process(single(SimplePlaylistPaging, from_item='playlists'))
@maximise_limit(50)
def category_playlists(
self,
category_id: str,
country: str = None,
limit: int = 20,
offset: int = 0
) -> SimplePlaylistPaging:
"""
Get a list of Spotify playlists tagged with a particular category.
Parameters
----------
category_id
category ID
country
@send_and_process(single(FullArtistOffsetPaging))
@maximise_limit(50)
def current_user_top_artists(
self,
time_range: str = 'medium_term',
limit: int = 20,
offset: int = 0
) -> FullArtistOffsetPaging:
"""
Get the current user's top artists.
Parameters
----------
time_range
Over what time frame are the affinities computed.
Valid-values: short_term, medium_term, long_term
limit
@send_and_process(single(FullAlbum))
def album(
self,
album_id: str,
market: str = None
) -> FullAlbum:
"""
Get an album.
Parameters
----------
album_id
album ID
market
an ISO 3166-1 alpha-2 country code or 'from_token'
"""
return self._get('albums/' + album_id, market=market)
@send_and_process(single(PublicUser))
def user(self, user_id: str) -> PublicUser:
"""
Get a user's profile.
Parameters
----------
user_id
user ID
"""
return self._get('users/' + user_id)
@send_and_process(single(Category))
def category(
self,
category_id: str,
country: str = None,
locale: str = None
) -> Category:
"""
Get a single category used to tag items in Spotify.
Parameters
----------
category_id
category ID
country
an ISO 3166-1 alpha-2 country code
locale
@send_and_process(single(FullTrack))
def track(
self,
track_id: str,
market: str = None
) -> FullTrack:
"""
Get information for a track.
Parameters
----------
track_id
track ID
market
an ISO 3166-1 alpha-2 country code or 'from_token'
"""
return self._get('tracks/' + track_id, market=market)