Skip to main content

A light weight Python library for the Spotify Web API

Project description

Spotipy

A light weight Python library for the Spotify Web API

Tests Documentation Status

Documentation

Spotipy's full documentation is online at Spotipy Documentation.

Installation

pip install spotipy

or upgrade

pip install spotipy --upgrade

Quick Start

A full set of examples can be found in the online documentation and in the Spotipy examples directory.

To get started, install spotipy and create an app on https://developers.spotify.com/. Add your new ID and SECRET to your environment:

Without user authentication

import spotipy
from spotipy.oauth2 import SpotifyClientCredentials

sp = spotipy.Spotify(auth_manager=SpotifyClientCredentials(client_id="YOUR_APP_CLIENT_ID",
                                                           client_secret="YOUR_APP_CLIENT_SECRET"))

results = sp.search(q='weezer', limit=20)
for idx, track in enumerate(results['tracks']['items']):
    print(idx, track['name'])

With user authentication

import spotipy
from spotipy.oauth2 import SpotifyOAuth

sp = spotipy.Spotify(auth_manager=SpotifyOAuth(client_id="YOUR_APP_CLIENT_ID",
                                               client_secret="YOUR_APP_CLIENT_SECRET",
                                               redirect_uri="YOUR_APP_REDIRECT_URI",
                                               username="YOUR_SPOTIFY_USERNAME",
                                               scope="user-library-read"))

results = sp.current_user_saved_tracks()
for idx, item in enumerate(results['items']):
    track = item['track']
    print(idx, track['artists'][0]['name'], " – ", track['name'])

Reporting Issues

For common questions please check our FAQ.

You can ask questions about Spotipy on Stack Overflow. Don’t forget to add the Spotipy tag, and any other relevant tags as well, before posting.

If you have suggestions, bugs or other issues specific to this library, file them here. Or just send a pull request.

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

spotipy-2.14.0.tar.gz (28.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

spotipy-2.14.0-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

spotipy-2.14.0-py2-none-any.whl (24.5 kB view details)

Uploaded Python 2

File details

Details for the file spotipy-2.14.0.tar.gz.

File metadata

  • Download URL: spotipy-2.14.0.tar.gz
  • Upload date:
  • Size: 28.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for spotipy-2.14.0.tar.gz
Algorithm Hash digest
SHA256 ab10d6525b7f85267c19f0eb5d31b7f15ae7c32d052bc62e21d9e24273d53f3a
MD5 40053a277385e016f5086ed9f9c2a532
BLAKE2b-256 ffb48eed2c2f6941dd1f6eedc01259a68f282286d14a33cf4ee098806d82b919

See more details on using hashes here.

File details

Details for the file spotipy-2.14.0-py3-none-any.whl.

File metadata

  • Download URL: spotipy-2.14.0-py3-none-any.whl
  • Upload date:
  • Size: 24.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for spotipy-2.14.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ba8413d16297df46246a3153299ad8e5f38e1d583e90ea0fc3e4638c0974d67c
MD5 8a1a501ac7687fa72bf38991e1621b3b
BLAKE2b-256 64afc2b43b8b624699101a9a8c5ba40bbaeaa1b60f1712f6a65fe2775e05f420

See more details on using hashes here.

File details

Details for the file spotipy-2.14.0-py2-none-any.whl.

File metadata

  • Download URL: spotipy-2.14.0-py2-none-any.whl
  • Upload date:
  • Size: 24.5 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for spotipy-2.14.0-py2-none-any.whl
Algorithm Hash digest
SHA256 c8d735b0507f88e45316d40965e1d3afbf387aa0e0a56a43d0a329ab10370f77
MD5 c98a1ad14c2009389d42ab5d1df62e16
BLAKE2b-256 310f48aa519dbd13978ea71cf9a93e5b39fa21ac54e60c3b0ee3ff05e50c7757

See more details on using hashes here.

Supported by

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