Skip to main content is an asynchronous API wrapper for Spotify written in Python.

Project description


Version info GitHub stars Discord

An API library for the spotify client and the Spotify Web API written in Python. is an, primarily, asyncronous library (everything down to the HTTP client is asyncio friendly).

Sync' support

The library also supports syncronous usage with spotify.sync

import spotify.sync as spotify  # Nothing requires async/await now!


  • Sorting a playlist by popularity
import sys

import spotify

playlist_uri =   # Playlist uri here
client_id =      # App client id here
secret =         # App secret here
token =          # User token here

client = spotify.Client(client_id, secret)

async def main():
    user = await spotify.User.from_token(client, token)

        playlist = next(playlist for playlist in (await user.get_playlists()) if playlist.uri == playlist_uri)
    except StopIteration:
        print('No playlists were found!', file=sys.stderr)
        tracks = await playlist.get_all_tracks()

    sorted_tracks = sorted(tracks, reverse=True, key=(lambda track: track.popularity))

    await user.replace_tracks(playlist, sorted_tracks)

if __name__ == '__main__':


To install the library simply clone it and run

  • git clone
  • python3 install

or use pypi

  • pip3 install spotify (latest stable)
  • pip3 install -U git+ (nightly)


For resources look at the examples or ask in the discord

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spotify-0.5.1.tar.gz (31.4 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page