Commit Graph
597 Commits
Author SHA1 Message Date
Pedro Rodriguesandavivaschmitz dd69a48659 Create tutorial for beginners (#872)
* Create TUTORIAL.md

* remova blank space

Co-authored-by: avivaschmitz <39923753+avivaschmitz@users.noreply.github.com>
2022-10-29 14:20:50 +01:00
Job Doesburg be759d3f50 Implement get-queue endpoint (#854) 2022-10-29 13:01:25 +01:00
Stephane Bruckert 5a7e5c5a43 Bump to 2.21.0, closes #836 2.21.0 2022-10-26 23:03:42 +01:00
Bruno Alla fd8f97d46a Add python 3.10 to GitHub Actions (#863) 2022-10-26 22:59:10 +01:00
Stephane Bruckert 06765c4f5a Fix flake8 2022-10-26 22:56:38 +01:00
Paulina Khew be27391461 Add missing step to CONTRIBUTING.md to activate virtualenv (#848) 2022-08-30 23:16:38 +01:00
Bryan Malyn 7fc08809f0 Add FlaskSessionCacheHandler (#833)
Updated examples/app.py
Updated CHANGELOG.md and appropriate docs.
2022-06-25 20:00:08 +01:00
Stephane Bruckert 7337bf9352 Fix readthedocs 2022-06-19 09:03:13 +01:00
Ian Rolph eab3c37b89 Updated documentation (#826)
* updated documentation

* updated changelog
2022-06-18 23:34:36 +01:00
Robinson Ibarra ca73420248 Added documentation for windows users attempting to set environment variables (#822) 2022-06-18 23:30:07 +01:00
Stephane Bruckert 36ea3d9319 Fix lint 2022-06-18 23:29:12 +01:00
mattrost 1b0c426984 Addition of Test Cases (#818)
* Added test_categories_country to use optional country selection for categories method.

* Added test_categories_locale for testing locale method of categories.

* Added test_categories_limit_low and test_categories_limit_high to test the limit method of categories for edge cases.

* Rearranged for flow

* Added test_category_playlists_limit_low and test_category_playlists_limit_high for testing the limit method.
2022-06-18 23:28:08 +01:00
dnlruizandStéphane Bruckert a4cfd83946 show_featured_artists.py and update publishing docs (#821)
* show_featured_artists.py and update publishing docs

* Don't update version

Co-authored-by: Stéphane Bruckert <contact@stephanebruckert.com>
2022-06-18 23:26:43 +01:00
Stephane Bruckert 61c8cda006 Fix lint 2022-06-18 23:24:49 +01:00
kanari1 6164dbb628 Fixed and clarified docstrings for client.py (#820)
* fixed docstring for current_user_following_users_function

* Edited docstrings for playlist_cover_image, user_playlist, user_playlist_replace_tracks, user_playlist_reorder_tracks functions

* expanded docstring description of playlist_change_details function to include changes to collaborative state and/or description
2022-06-18 23:20:37 +01:00
darwady2 c6b56a658a Add YT video URL to doc (#816)
For a final assignment in a class, I've created a How-To video that showcases how to get setup with API credentials, Redirect URIs, and Spotify Developer Accounts, all of which are necessary prerequisites to using the Spotipy library.

I wanted to do this because, in my past experience, the most frustrating thing about working with APIs and libraries is authentication. Spotipy does a nice job of wrapping some of this and making it easier on the developer, but it still takes some setup before successful use.

Specifically, my video goes through the following:
* Installing Spotipy
* Setting up a Spotify Developer Account
* Configuring the Redirect URI
* Getting the Client Secret and Public Keys
* Setting the envars for use with Spotipy
* Running a sample piece of code from Spotipy to show that things are setup properly
2022-06-18 23:20:11 +01:00
Logan O'Connell 13593c54cb Added a new example: follow_playlist.py (#804)
* Create playlist_all_local_tracks.py

* Delete playlist_all_local_tracks.py

* Create follow_playlist.py
2022-06-18 23:19:27 +01:00
ivyadam 5175f19851 Updated documentation about ISO-639 language codes and address issue #753 (#800)
* Updated references to ISO 639 standard to clarify that the ISO 639-1 alpha-2 standard is used.

* Added `market` parameter to `album` and `albums`

* fix formatting change
2022-06-18 23:18:59 +01:00
Andrii Oriekhov 14ee53eacd Add GitHub URL for PyPi (#787) 2022-06-18 23:18:20 +01:00
Mohammad Momeni 72a6cd9190 Fix text attribute for Response object (#811)
* Fix text attribute for Response object

* Add a changelog for the AttributeError PR
2022-06-18 23:17:58 +01:00
Stephane Bruckert c1a85f1469 Bump to 2.20.0, closes #806 2.20.0 2022-06-18 22:59:37 +01:00
Stéphane Bruckert 98f0f76238 Removed Python 3.5 and added Python 3.9 in Github Action (#831)
* Removed python3.5 from CI

* Add python 3.9
2022-06-18 22:56:42 +01:00
ENT8R 9a627e88f4 Simplify check for existing token (#765)
* Simplify check for existing token in RedisCacheHandler

* Update CHANGELOG.md
2022-01-03 19:33:13 +01:00
ENT8R 08411b9031 Allow to set custom key in RedisCacheHandler (#761)
* Allow to set custom key in RedisCacheHandler

* Update CHANGELOG.md

* Check for the existence of the key
2021-12-22 15:44:38 +01:00
Felix Cusson 0464f4f483 Remove query parameters from URI (#758)
* made _get_id take account of ? in URI

* corrected typo

* changes to _get_id explained
2021-12-17 22:20:47 +00:00
rautskaa 2aeda6a2c2 Adding example for unfollowing/deleting a playlist (#746)
* Adding example for deleting a playlist

* Renaming to unfollow_playlist
2021-11-23 21:48:53 +00:00
Takehisa Oyama 7d23fc3277 Add RedisCacheHandler (#747)
* add RedisCacheHandler

* add the explanation for customized chache handlers

* update the dependency and chengelog
2021-11-22 19:31:58 +00:00
StopMotionCuber 0a9270f385 Update link to usage scopes (#738) 2021-10-30 21:22:21 +01:00
Yash a81aa595ba Fixed some playlist functions docstrings (#732)
playlist_items(), playlist_cover_image() functions can take ID, URI or URL. Current docstring only mentions ID. This can also be verified and tested out. Example in examples folder also uses URI with playlist_items().
2021-09-30 22:01:12 +01:00
Stephane Bruckert 48d04f343b Bump to 2.19.0 2.19.0 2021-08-12 11:27:26 +01:00
Stéphane Bruckert b80bfa5c52 Generate license (#699)
* Create LICENSE

* Delete LICENSE.md

* Update setup.py

* Update CHANGELOG.md
2021-06-28 20:54:42 +01:00
dvirOsher 1a6df54111 update current_user_saved_albums function message (#697)
max limit spotipy can handler without getting any HTTP 401 error is 50.
2021-06-26 20:20:45 +01:00
Michael Stewart 72280c850b Update index.rst (#696)
Not sure how to edit RSt properly, but wanted to point out for others the superhelpful feature that spotipy already includes code to launch an http server to listen for the http callback
2021-06-26 20:19:44 +01:00
Peter SchornandStéphane Bruckert 06551cd055 Fallback on decoding error responses into string if decoding into JSON fails (#689)
* Fixed a bug in the initializers for the auth managers that produced a spurious warning message if you provide a cache handler and you set a value for the "SPOTIPY_CLIENT_USERNAME" environment variable.

* fixed a bug in _get_auth_response_local_server which occurs if you provide a state parameter and click cancel in the authorization dialog

* Fallback on decoding the error response body into text if decoding into JSON fails.

* Fall back on decoding oauth errors into text if decoding into JSON fails.

* Fixed unused `http_error` name in exeception clause.

* Updated CHANGELOG

Co-authored-by: Stéphane Bruckert <stephane.bruckert@gmail.com>
2021-06-19 15:59:02 +02:00
Varun Patil d0fc4425f7 Added DjangoSessionCacheHandler (#691)
* Added DjangoSessionCacheHandler

Added `DjangoSessionCacheHandler`, a cache handler that stores the token in the session framework provided by Django. Web apps using spotipy with Django can directly use this for cache handling.

* removed whitespaces
2021-06-19 15:57:36 +02:00
Gustavo Krieger 85746e4e62 set cache checking to false so that failing test passes (#682) 2021-04-25 22:02:07 +01:00
Gustavo Krieger e4c581bbb6 add tearDownClass to unfollow test playlist after tests (#680) 2021-04-23 18:41:50 +01:00
Gustavo Krieger 49f46264c7 change assertGreater to assertGreaterEqual in some tests (#679) 2021-04-23 18:41:11 +01:00
Peter Schorn c4f6a3fa4b Fixed a bug in the initializers for the auth managers that produced a spurious warning message if you provide a cache handler and you set a value for the "SPOTIPY_CLIENT_USERNAME" environment variable. (#674) 2021-04-19 20:17:54 +01:00
Peter Schorn 07915e21e5 Added MemoryCacheHandler (#670)
* Added `MemoryCacheHandler`, a cache handler that simply stores the token info in memory as an instance attribute of this class.

* Fixed a bug in `CacheFileHandler.__init__`: The documentation says that the username will be retrieved from the environment, but it wasn't.
2021-04-14 16:59:37 +01:00
Stephane Bruckert 36bdeb0a65 Bump to 2.18.0 2.18.0 2021-04-13 21:32:51 +01:00
Peter SchornandStéphane Bruckert 25f9df2dd5 Added new endpoints (#666)
* Added an exception clause that catches `FileNotFoundError` and logs a debug message in `SpotifyOAuth.get_cached_token`, `SpotifyPKCE.get_cached_token` and `SpotifyImplicitGrant.get_cached_token`.

* Changed docs for `auth` parameter of `Spotify.init` to `access token` instead of `authorization token`. In issue #599, a user confused the access token with the authorization code.

* Updated CHANGELOG.md

* Removed `FileNotFoundError` because it does not exist in python 2.7 (*sigh*) and replaced it with a call to `os.path.exists`.

* Replaced ` os.path.exists` with `error.errno == errno.ENOENT` to supress errors when the cache file does not exist.

* Changed docs for `search` to mention that you can provide multiple multiple types to search for. The query parameters of requests are now logged. Added log messages for when the access token and refresh tokens are retrieved and when they are refreshed. Other small grammar fixes.

* Removed duplicate word "multiple" from CHANGELOG

* * Fixed the bugs in `SpotifyOAuth.refresh_access_token` and `SpotifyPKCE.refresh_access_token` which raised the incorrect exception upon receiving an error response from the server. This addresses #645.
* Fixed a bug in `RequestHandler.do_GET` in which the non-existent `state` attribute of  `SpotifyOauthError` is accessed. This bug occurs when the user clicks "cancel" in the permissions dialog that opens in the browser.
* Cleaned up the documentation for `SpotifyClientCredentials.__init__`, `SpotifyOAuth.__init__`, and `SpotifyPKCE.__init__`.

* Removed unneeded import

* Added the following endpoints:
 `Spotify.current_user_saved_episodes` `Spotify.current_user_saved_episodes_add` `Spotify.current_user_saved_episodes_delete` `Spotify.current_user_saved_episodes_contains` `Spotify.available_markets`
 Added tests for the above endpoints.

* updated CHANGELOG

* Fixed flake8 issue

Co-authored-by: Stéphane Bruckert <stephane.bruckert@gmail.com>
2021-04-10 14:53:03 +01:00
yashsinha848 f42024737e Update artist_discography.py (#664) 2021-04-04 11:52:02 +01:00
yashsinha848 8db120f985 Update simple3.py (#663) 2021-04-04 11:51:55 +01:00
Peter SchornandStéphane Bruckert dc89a00113 Added cache handler to SpotifyClientCredentials and fixed a bug in refresh tokens methods that raised the wrong exception (#655)
* Added an exception clause that catches `FileNotFoundError` and logs a debug message in `SpotifyOAuth.get_cached_token`, `SpotifyPKCE.get_cached_token` and `SpotifyImplicitGrant.get_cached_token`.

* Changed docs for `auth` parameter of `Spotify.init` to `access token` instead of `authorization token`. In issue #599, a user confused the access token with the authorization code.

* Updated CHANGELOG.md

* Removed `FileNotFoundError` because it does not exist in python 2.7 (*sigh*) and replaced it with a call to `os.path.exists`.

* Replaced ` os.path.exists` with `error.errno == errno.ENOENT` to supress errors when the cache file does not exist.

* Changed docs for `search` to mention that you can provide multiple multiple types to search for. The query parameters of requests are now logged. Added log messages for when the access token and refresh tokens are retrieved and when they are refreshed. Other small grammar fixes.

* Removed duplicate word "multiple" from CHANGELOG

* * Fixed the bugs in `SpotifyOAuth.refresh_access_token` and `SpotifyPKCE.refresh_access_token` which raised the incorrect exception upon receiving an error response from the server. This addresses #645.
* Fixed a bug in `RequestHandler.do_GET` in which the non-existent `state` attribute of  `SpotifyOauthError` is accessed. This bug occurs when the user clicks "cancel" in the permissions dialog that opens in the browser.
* Cleaned up the documentation for `SpotifyClientCredentials.__init__`, `SpotifyOAuth.__init__`, and `SpotifyPKCE.__init__`.

* Removed unneeded import

Co-authored-by: Stéphane Bruckert <stephane.bruckert@gmail.com>
2021-03-13 14:34:52 +01:00
Stephane Bruckert cb5c61881e Fix changelog 2021-03-04 21:18:44 +01:00
Omer Korner e07dd64925 Allow the scope to be either a list or comma separated string (#650)
* Allow the scope to be either a list or comma separated string

* Move normalize scope to util file and make it a base method

Also adjust documentation to reflect the new scope parameter supporting a list

* Add change to CHANGELOG.md
2021-03-04 18:56:39 +01:00
Rob Sanek d001326cc3 Allow both id types in playlist_change_details (#649) 2021-03-02 19:41:14 +01:00
Stéphane Bruckert be399fd089 Update urllib3, fixes #647 (#648)
* Bump urllib3, fixes #647

* FAQ update
2.17.1
2021-02-28 14:53:02 +01:00
Stephane Bruckert e35f6ec5ad Fix lint 2021-02-28 10:16:21 +01:00