spotify_token_refresh package

Submodules

spotify_token_refresh.refresh module

Functions interacting with keys JSON file. Keys file format should be:

{
    "client_id": "<Your Client ID>",
    "client_secret": "<Your Client Secret ID>",
    "access_token": "<Access Token>",
    "refresh_token": "<Refresh Token>"
}
spotify_token_refresh.refresh.get_access_token(keys_filename='keys.json')

Gets the access_token value from the keys JSON file

Parameters

keys_filename (str (default is “keys.json”)) – Filename of keys JSON

Returns

Value of access_token from keys JSON

Return type

str

spotify_token_refresh.refresh.refresh_spotify_access_token(keys_filename='keys.json', output_file=None)

Refreshes the access token in a json file with the contents:

{
    "client_id": "client id",
    "client_secret": "client secret",
    "access_token": "access token",
    "refresh_token": "refresh token"
}
Parameters
  • keys_filename (str (default is “keys.json”)) – Path to json file

  • output_file (str (default is None)) – Path to save updated json file; if None, update the file that was loaded

Returns

Value for access_token is modified for the file in place or in output_file

Return type

None

Module contents