Commit Graph
695 Commits
Author SHA1 Message Date
Stéphane Bruckert 68ee2d6de8 Sync branches (#667) 2024-10-13 21:30:56 +02:00
Peter SchornandStéphane Bruckert 97cb986477 V3 (#665)
* 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 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>

* Made `CacheHandler` an abstract base class

Added:

* `Scope` - An enum which contains all of the authorization scopes (see [here](https://github.com/plamere/spotipy/issues/652#issuecomment-797461311)).

* 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

* Fixed formatting issues. Removed python 2.7 from github workflows.

* Added python 3.9 to github workflows. The type hints for set now uses the generic typing.Set instead of builtins.set.

* Changed f-string to percent-formatted string.

* Fixed the duplicate "###Changed" section in the change log.

Co-authored-by: Stéphane Bruckert <stephane.bruckert@gmail.com>
2024-10-13 21:30:48 +02:00
badfarmerjohnandStéphane Bruckert 7bb3e7349f Fixed audio_features API wrapper function return structure (#653)
Co-authored-by: Stéphane Bruckert <stephane.bruckert@gmail.com>
2024-10-13 21:24:17 +02:00
Stephane Bruckert a614748ad7 Update changelog and setup to v3 2024-10-13 20:39:21 +02:00
Peter-Schorn c8915dcc91 Fixed a bug in CacheFileHandler.__init__: The documentation says that the username will be retrieved from the environment, but it wasn't. 2024-10-13 20:38:16 +02:00
Niko db3fb9a5ee created SpotifyBaseException and moved exceptions from oauth2.py to exceptions.py (#1161) 2024-10-08 18:40:53 +02:00
Stéphane Bruckert d9da5af53c Fix README tests badge 2024-07-30 16:46:22 +01:00
Stéphane Bruckert c6209436d1 Add Discord badge to README (#1150) 2024-07-28 15:28:59 +01:00
dependabot[bot] 185140a812 Update sphinx requirement from ~=7.3.7 to ~=7.4.7 (#1148)
Updates the requirements on [sphinx](https://github.com/sphinx-doc/sphinx) to permit the latest version.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES.rst)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v7.3.7...v7.4.7)

---
updated-dependencies:
- dependency-name: sphinx
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 16:42:12 +02:00
ArefandStéphane Bruckert 51c5bd8d7d Advanced examples (#986)
* Created a testing suite for the spotipy client.Spotify class

* Delete pyvenv.cfg

* Corrected error in description

* Added some advanced usage examples, some of which involve utilizing basic data analysis methods using other libraries such as Pandas

* Minor formatting fixes

---------

Co-authored-by: Stéphane Bruckert <stephane.bruckert@gmail.com>
2024-07-09 20:02:07 +01:00
JackDyre 1e05bdba67 ID support for current_user_unfollow_playlist() (#1143)
* ID support for `current_user_unfollow_playlist()`

* turned double quotes into single quotes

* Clarified changelog entry
2024-06-30 21:34:14 +02:00
Niko 66ad716595 Print warnings when a rate/request limit is reached (#1134)
* create custom urllib3.Retry class for printing warnings on rate/request limits

* move import urllib3 from client.py to util.py

* Using Retry.increment instead of Retry.is_retry. Shows the Retry-After value in the warning as well

* Making sure that max column <= 99

* add types.TracebackType

* Change warning in request/rate limit warning

* adding all parameters, just to make sure

* fixing length of line

* making sure that response is not None
2024-06-25 09:26:19 +02:00
Niko 5e09c78ccf Added an explanation for rate/request limits to FAQ (#1133) 2024-06-24 23:43:54 +02:00
Stéphane Bruckert ef282e2423 Removed outdated contributors from RTD 2024-06-23 22:30:54 +01:00
Brandon ParrottandStéphane Bruckert d7640404a5 client.py docstring updates (#1060)
* Update client.py 

Added warnings in docstrings for functions that have been replaced and call other new functions.

* Update CHANGELOG.md

---------

Co-authored-by: Stéphane Bruckert <contact@stephanebruckert.com>
2024-06-23 22:29:28 +01:00
Stéphane Bruckert c90ce4a875 Fix audiobook integration tests (#1141) 2024-06-23 22:13:44 +01:00
Stéphane Bruckert c7856d0120 Don't run integration tests twice on PR 2024-06-23 20:39:17 +01:00
Brennan PateandNiko d92951b356 Update Directions In TUTORIAL.md; Add Unit Tests To non_user_endpoints test.py (#1136)
* Update navigational directions in Step 1(A)

* Combine directions in Step 1(B) and Step 2(C) and remove Step 2(C)

* Update navigational directions and verbage in Step 1(C)

* Change reference from Step 1(C) to Step 1(B) in Step 2(D)

* Update capitalization in Prerequisites Step 3

* Add directions for installing Spotipy in Prerequisites Step 1(A)

* List updates to TUTORIAL.md file in CHANGELOG.md

* Update docstrings for funcs in lines 340-585

* Add unit tests for artist ID and URL

* Add test_artists_mixed_ids

* Updated CHANGELOG.md and TUTORIAL.md as requested

* Update client.py and test.py

* Fix linting issue

* Remove duplicate line; Change order of prerequisites

* Update local repo

* Add test_artists_mixed_ids

* Add Radiohead ID and URL; Add qotsa URL

* Add test_artist_url

* Comment out three failing tests

* Fix linting errors

* Uncommenting out failed tests

* Add test_artist_id

* List changes in CHANGELOG.md

* Add line breaks at the end of files.

* Remove multiple spaces

Also I've removed a sentence that just doesn't make sense in my eyes, but was added before this PR.

---------

Co-authored-by: Niko <github@dieserniko.link>
2024-06-22 17:35:53 +02:00
Dianna 8f003147f7 Added and revised function docstrings for util.py (#1130)
* Added and revised function docstrings for util.py

* added credentials to gitignore

* Addressed request changes by reverting/modifying function docstrings to match the format used in client.py
2024-06-18 10:30:04 +02:00
Stephane Bruckert c5a0943016 Uncomment temporarily failing test 2024-06-01 19:34:44 +01:00
Brandon ParrottandStéphane Bruckert f94a89a995 Add unit tests for queue functions (#1059)
* Update test.py

Add tests for queue manipulation/retrieval functions

* Update CHANGELOG.md

* flake8

---------

Co-authored-by: Stéphane Bruckert <stephane.bruckert@gmail.com>
2024-05-31 17:46:19 +01:00
Stephane Bruckert cb36133ca9 Comment out test failing with payment_required 2024-05-31 17:42:28 +01:00
Stéphane Bruckert bb36290b8e Fix TOC in readme 2024-05-31 08:11:58 +01:00
Stéphane Bruckert 9a8b8a7f02 Update README.md 2024-05-31 08:10:05 +01:00
Michał Górny eee7ae7d0d Remove obsolete mock dependency (#1127)
The package uses `unittest.mock` only, and that one is part
of the Python standard library.
2024-05-31 08:08:24 +01:00
Stephane Bruckert 8a40e038b9 Remove python2.7 from pypi build 2.24.0 2024-05-30 22:06:13 +01:00
Stephane Bruckert c0343b8b80 Bump to 2.24.0 2024-05-30 22:03:18 +01:00
AllieandStéphane Bruckert 5fa2343162 TUTORIAL.md updates (#1009)
* Update TUTORIAL.md

Added instructions for installing Spotipy.

* Update TUTORIAL.md

Updated Spotify app creation steps.

---------

Co-authored-by: Stéphane Bruckert <stephane.bruckert@gmail.com>
2024-05-30 20:14:15 +01:00
NickandStéphane Bruckert 22e3b7406d Update current_user_follow_playlist (#1040)
* Update current_user_follow_playlist

The API specifies a `public` parameter as seen [here](https://developer.spotify.com/documentation/web-api/reference/follow-playlist)

* Update CHANGELOG.md

---------

Co-authored-by: Stéphane Bruckert <stephane.bruckert@gmail.com>
2024-05-30 19:43:10 +01:00
wouldubeandStéphane Bruckert a810edf5da Corrections to Grammar Errors and Typos in Documentation (#1017)
* Fixed grammar errors and typos.

* Update CHANGELOG.md to mention documentation typo corrections.

---------

Co-authored-by: Stéphane Bruckert <stephane.bruckert@gmail.com>
2024-05-30 19:37:39 +01:00
Niko 126da62dd0 Fix API Reference (#1126)
* add base directory to PATH

* Check if build completes if redis is included
2024-05-30 20:33:17 +02:00
Shukie LiandStéphane Bruckert df27fe93bf Combined assertion tests, fixes #1051 (#1052)
* addressed issue 936

* publish branch

* 12/9/2023

* Update CHANGELOG.md

---------

Co-authored-by: Stéphane Bruckert <stephane.bruckert@gmail.com>
2024-05-30 19:29:32 +01:00
andrewcaraandStéphane Bruckert 62a27a20e0 Added MemcacheCacheHandler (#1042)
* Added MemcacheCacheHandler

* Import MemcacheError where used

* Update index.rst

---------

Co-authored-by: Stéphane Bruckert <stephane.bruckert@gmail.com>
2024-05-30 19:01:16 +01:00
Stéphane Bruckert 913ae57275 Fix docs badge
Latest was removed on RTD and is equivalent to master
2024-05-29 08:49:27 +01:00
Stéphane Bruckert 1ce8c4f06b RTD theme fix (#1122)
* pip sphinx-rtd-theme

* Bump sphinx

* Add extension

* Add docs/requirements.txt

* CL
2024-05-28 09:08:23 +01:00
Stephane Bruckert 2d1cb99be7 Use sphinx_rtd_theme 2024-05-28 08:36:22 +01:00
Stéphane Bruckert cc24b4c22f Fix RTD build 2024-05-27 13:06:21 +01:00
Stéphane Bruckert 677841b417 Create .readthedocs.yaml (#1120)
* Create .readthedocs.yaml

* Update CHANGELOG.md
2024-05-27 13:01:01 +01:00
jackattack825 e153dabe7c Update index.rst (#1087)
spelling issue
2024-05-23 07:40:08 +02:00
Niko 939b7557a5 Updated _regex_spotify_url to ignore /intl-<countrycode> in Spotify links (#1100)
* Updated _regex_spotify_url to ignore /intl-<countrycode> in Spotify links

* Updated documentation link and added some additional information
2024-05-22 12:43:04 +02:00
Hugo van KemenadeandNiko b109ca722c Bump GitHub Actions (#1113)
Co-authored-by: Niko <github@dieserniko.link>
2024-05-21 23:01:02 +02:00
Hugo van KemenadeandHugo van Kemenade 85c9d74dc1 Drop support for EOL Python 3.7 (#1065)
* Add python_requires to help pip

* Update supported versions in tox.ini

* Upgrade Python syntax with pyupgrade --py37-plus

* Bump GitHub Actions

* Add Python 3.11 and 3.12 to CI

* Remove six dependency

* Remove redundant dependencies

* Remove redudant Python 3.5 code

* Drop support for EOL Python 3.7

* Upgrade Python syntax with pyupgrade --py38-plus

* Update CHANGELOG

* More f-strings

---------

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2024-05-21 18:32:01 +02:00
melissa 958ff6ad2b Reorganized index.rst for improved logical flow (#1054)
* reorganized sections without changing any header. Made a few small grammar fixes.

* cleaning up examples section.

* updating changelog for proposed edits
2024-05-21 10:28:38 +02:00
Dianna 74330dae6d Updated TUTORIAL.md with an additional instructional step and Troubleshooting Section (#1104)
* updated TUTORIAL.md with Troubleshooting section and an added step to Prerequisite instructions

* Update TUTORIAL.md

Editing grammatical syntax and formatting

* Update CHANGELOG.md
2024-05-18 21:46:03 +02:00
Niko 070b54f494 Merge pull request #1108 from spotipy-dev/1107-artist_albums-include_groups
Replaced argument "album_type" with "include_groups" in "Spotify.artist_albums"
2024-05-17 14:39:26 +02:00
NikoandStéphane Bruckert 3b5708f5a0 Update spotipy/client.py
Co-authored-by: Stéphane Bruckert <stephane.bruckert@gmail.com>
2024-05-17 14:38:19 +02:00
Niko 52f2b923ba Removing whitespace (new IDE, sorry) 2024-05-17 12:46:23 +02:00
Niko f4c2b90a29 Made sure that the line column is not over 99. 2024-05-17 12:41:57 +02:00
Niko 0a8e7f635e Added missing comma to artist_albums 2024-05-17 12:37:54 +02:00
Niko 2e54f2c138 Replaced argument "album_type" with "include_groups" in "Spotify.artist_albums" 2024-05-17 12:35:23 +02:00