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",
                                               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.20.0.tar.gz (33.6 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.20.0-py3-none-any.whl (27.9 kB view details)

Uploaded Python 3

spotipy-2.20.0-py2-none-any.whl (27.9 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: spotipy-2.20.0.tar.gz
  • Upload date:
  • Size: 33.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.26.0 setuptools/60.5.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.10

File hashes

Hashes for spotipy-2.20.0.tar.gz
Algorithm Hash digest
SHA256 e26a99b75be2fc42375b2b4b355dc44fa1e59efc773afa17b784e1a4c0a818c9
MD5 64f3ff6205f3035834445fc92c2d0c5c
BLAKE2b-256 80396636edd9f4894c7aeee64d1879e76be5687484a7694480c937a302f5c9d5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spotipy-2.20.0-py3-none-any.whl
  • Upload date:
  • Size: 27.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.26.0 setuptools/60.5.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.10

File hashes

Hashes for spotipy-2.20.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d63a921ca6287eec12fdc72b80977df086d4f8609cd962fe8397a4a82165db5e
MD5 e36925d04c1c02ab9d152ad13e5e6dda
BLAKE2b-256 1e459c24de141001228594779beee27e472a926a7bdef436389236d0e3802243

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spotipy-2.20.0-py2-none-any.whl
  • Upload date:
  • Size: 27.9 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.26.0 setuptools/60.5.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.10

File hashes

Hashes for spotipy-2.20.0-py2-none-any.whl
Algorithm Hash digest
SHA256 b5844cef1d4e5f76c14e4e92a7072ab333844057c01eb24a09d38fb761716b1f
MD5 c81f21582b8bd87f35784a27d94995bb
BLAKE2b-256 4ff9b7540872edfe06d6e4fcfcae5b3fc228b615017f81403be9740cfa133058

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