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.21.0.tar.gz (34.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.21.0-py3-none-any.whl (28.0 kB view details)

Uploaded Python 3

spotipy-2.21.0-py2-none-any.whl (28.0 kB view details)

Uploaded Python 2

File details

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

File metadata

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

File hashes

Hashes for spotipy-2.21.0.tar.gz
Algorithm Hash digest
SHA256 621161a9b5aa015681c2ee1bb8873cee2ee6b440d84040da9d2a57cd67f7d5e5
MD5 39516004f484c3eb82ff6c4ab05596ee
BLAKE2b-256 dedafa96cb974b634e58f7e7a1ec9453a1d385e489fb9044f4ea318ff8794443

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for spotipy-2.21.0-py3-none-any.whl
Algorithm Hash digest
SHA256 26f6f924ffed5195601c6d623dfd1f822474ffdac7e5c61ab63b468aaa48b196
MD5 245258e176e2b0c8a63db0a788a37dc2
BLAKE2b-256 4a87022aa22b6ac9789907291da4f227b990c96b2536fab15597db7bed149f3f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for spotipy-2.21.0-py2-none-any.whl
Algorithm Hash digest
SHA256 1e34fe31fe0722e4a3cb85d90003948924b1dd8c28367ea8e0f8d11662e63c76
MD5 e1a1bd7ecba361831efd93c73472e4e5
BLAKE2b-256 228b89ea2f6cfd2d4852be92761ac93e4322ca0a6339af7561eed53b62497795

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