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

export SPOTIPY_CLIENT_ID=client_id_here
export SPOTIPY_CLIENT_SECRET=client_secret_here

// on Windows, use `SET` instead of `export`
import spotipy
from spotipy.oauth2 import SpotifyClientCredentials

sp = spotipy.Spotify(auth_manager=SpotifyClientCredentials())

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

With user authentication

export SPOTIPY_CLIENT_ID=client_id_here
export SPOTIPY_CLIENT_SECRET=client_secret_here
export SPOTIPY_REDIRECT_URI=redirect_uri_here

// on Windows, use `SET` instead of `export`
import spotipy
from spotipy.oauth2 import SpotifyOAuth

scope = "user-library-read"

sp = spotipy.Spotify(auth_manager=SpotifyOAuth(scope=scope))

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.13.0.tar.gz (24.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.13.0-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

spotipy-2.13.0-py2-none-any.whl (21.2 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: spotipy-2.13.0.tar.gz
  • Upload date:
  • Size: 24.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.8.0 tqdm/4.38.0 CPython/3.7.7

File hashes

Hashes for spotipy-2.13.0.tar.gz
Algorithm Hash digest
SHA256 d1a85b8831ed60d2290ab9bbba289c548fb9680889757252c02dab2f2327d865
MD5 a059271379df254d4a6399d1ca34cd24
BLAKE2b-256 c8e51431b838e7c809c1818d442dec2c54a4b5adb9a815c0c44dbe832da69323

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spotipy-2.13.0-py3-none-any.whl
  • Upload date:
  • Size: 21.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.8.0 tqdm/4.38.0 CPython/3.7.7

File hashes

Hashes for spotipy-2.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a8221233a486584666ab20faf730439b5d8026d63c162cd51bda752ec7c91deb
MD5 db759c2ea2ddb4c88dc96577cd627acf
BLAKE2b-256 f162210c7942dede1c0d39aa56520d59c4565e232f957ea4caea87da7e6f3e61

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spotipy-2.13.0-py2-none-any.whl
  • Upload date:
  • Size: 21.2 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.8.0 tqdm/4.38.0 CPython/3.7.7

File hashes

Hashes for spotipy-2.13.0-py2-none-any.whl
Algorithm Hash digest
SHA256 600f05bccd4b4217a02843a01025cf94b65c2ff2babeff3dcbd091a6e09ab0af
MD5 57940f9722a2ce0e9705f11ef2ecaccf
BLAKE2b-256 abcae7098b53b83674617fcb540d580c62bc92855dcdfe44f73edf85fe29fa8d

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