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.22.1.tar.gz (38.8 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.22.1-py3-none-any.whl (28.9 kB view details)

Uploaded Python 3

spotipy-2.22.1-py2-none-any.whl (28.9 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: spotipy-2.22.1.tar.gz
  • Upload date:
  • Size: 38.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for spotipy-2.22.1.tar.gz
Algorithm Hash digest
SHA256 54680dbf243a2b0cff0e591e1d269692e94265273b52ab90994a661555c04ac7
MD5 72a180de5a781e378035bbe03522604b
BLAKE2b-256 37fd822d49ffef8e18c6c238d8edfaeac69b44b7983b47300f7c05827aea01e6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spotipy-2.22.1-py3-none-any.whl
  • Upload date:
  • Size: 28.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for spotipy-2.22.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1dac15ac0aaf5246461a3cb0b3d837bc7af7b78597441289b500a5abac9fe9c4
MD5 4e8934175e3dfa30af9266f6bce71dd1
BLAKE2b-256 30d88e38e4a9001128e871450cc2a270f03303f76a39a92b0265be1a63a25e15

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spotipy-2.22.1-py2-none-any.whl
  • Upload date:
  • Size: 28.9 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for spotipy-2.22.1-py2-none-any.whl
Algorithm Hash digest
SHA256 aa023d8bc606053d95e8961f52293fdd8cd12ef4fad8f829e701bb3d61c48d76
MD5 d001250a0b82996ab4fbf0a35395852f
BLAKE2b-256 1847fdef1a5e1360ea77ba01d3635fb982573dd07905d619eccc4c32a5db1ef5

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