How to use the tekore._client.process.single function in tekore

To help you get started, we’ve selected a few tekore examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github felix-hilden / spotipy / tekore / _client / api / show.py View on Github external
    @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
github felix-hilden / spotipy / tekore / _client / api / follow.py View on Github external
    @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
        """
github felix-hilden / spotipy / tekore / _client / api / library.py View on Github external
    @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)
github felix-hilden / spotipy / tekore / _client / api / browse / __init__.py View on Github external
    @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
github felix-hilden / spotipy / tekore / _client / api / browse / __init__.py View on Github external
    @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
github felix-hilden / spotipy / tekore / _client / api / personalisation.py View on Github external
    @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
github felix-hilden / spotipy / tekore / _client / api / album.py View on Github external
    @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)
github felix-hilden / spotipy / tekore / _client / api / user.py View on Github external
    @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)
github felix-hilden / spotipy / tekore / _client / api / browse / __init__.py View on Github external
    @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
github felix-hilden / spotipy / tekore / _client / api / track.py View on Github external
    @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)