spotifylib package

Submodules

spotifylib.constants module

defines constants

Static URL’s and variables

spotifylib.spotifylib module

This module makes use of Spotipy’s methods but modifying the authentication in a simple and transparent way from the user without any need of 3rd party application to follow the OAuth flow as mentioned in the following documentation page.

https://developer.spotify.com/web-api/authorization-guide/#authorization_code_flow

class spotifylib.spotifylib.Spotify[source]

Bases: object

Library’s interface object

Instantiates the authentication object to figure out the token and passes it alongside the session to Spotipy’s in order to use its methods.

class spotifylib.spotifylib.SpotifyAuthenticator(client_id, client_secret, username, password, callback, scope)[source]

Bases: object

Authenticator object

This object handles authentication for all requests. In order to retrieve all values for this to work, one has to create a new application under his/her account.

https://developer.spotify.com/my-applications/#!/applications

token
class spotifylib.spotifylib.Token(access_token, token_type, expires_in, refresh_token, scope)

Bases: tuple

access_token

Alias for field number 0

expires_in

Alias for field number 2

refresh_token

Alias for field number 3

scope

Alias for field number 4

token_type

Alias for field number 1

class spotifylib.spotifylib.User(client_id, client_secret, username, password)

Bases: tuple

client_id

Alias for field number 0

client_secret

Alias for field number 1

password

Alias for field number 3

username

Alias for field number 2

spotifylib.spotifylibexceptions module

Main module Exceptions file

Put your exception classes here

exception spotifylib.spotifylibexceptions.SpotifyError[source]

Bases: exceptions.Exception

Generic error handler while interacting with Spotify API

These errors appear when trying to get access grants and we get a 400 Error

  • Wrong client_id

'INVALID_CLIENT: Invalid client'

  • Wrong response_type

'response_type must be code or token'

  • Invalid scope

'INVALID_SCOPE: Invalid scope'

  • Invalid CSRF cookie

'{"error":"errorCSRF"}'

  • Invalid redirect_uri

'Illegal redirect_uri'

Module contents

spotifylib package

Imports all parts from spotifylib here