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

alternatively, for Windows users

py -m 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

A redirect URI must be added to your application at My Dashboard to access user authenticated features.

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.23.0.tar.gz (38.5 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.23.0-py3-none-any.whl (29.1 kB view details)

Uploaded Python 3

spotipy-2.23.0-py2-none-any.whl (29.1 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: spotipy-2.23.0.tar.gz
  • Upload date:
  • Size: 38.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for spotipy-2.23.0.tar.gz
Algorithm Hash digest
SHA256 0dfafe08239daae6c16faa68f60b5775d40c4110725e1a7c545ad4c7fb66d4e8
MD5 18195faca386f743e12ad03a4ee06d88
BLAKE2b-256 eb643be93b08e95c4e9fd8270d7ef750efc6d454b6479adb91f36f316770f53e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spotipy-2.23.0-py3-none-any.whl
  • Upload date:
  • Size: 29.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for spotipy-2.23.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6bf8b963c10d0a3e51037e4baf92e29732dee36b2a1f1b7dcc8cd5771e662a5b
MD5 d60401c31519500bcfe69d90cfddccdd
BLAKE2b-256 b8e84c099f9431ec9a86f576b344702cd4446d1ff7df09b172dc1951f25d58b1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spotipy-2.23.0-py2-none-any.whl
  • Upload date:
  • Size: 29.1 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for spotipy-2.23.0-py2-none-any.whl
Algorithm Hash digest
SHA256 da850fbf62faaa05912132d2886c293a5fbbe8350d0821e7208a6a2fdd6a0079
MD5 7afc80a1f4661ef14fb86fb57a9b3ad0
BLAKE2b-256 2eaf0cec225516021689d0e12d615f4d9da8277ad97d032ea5ecdb556a501d32

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