mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-06-19 09:13:53 +00:00
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>
This commit is contained in:
parent
126da62dd0
commit
a810edf5da
28
CHANGELOG.md
28
CHANGELOG.md
@ -27,16 +27,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Replaced `artist_albums(album_type=...)` with `artist_albums(include_groups=...)` due to an API change.
|
- Replaced `artist_albums(album_type=...)` with `artist_albums(include_groups=...)` due to an API change.
|
||||||
- Restructured the tutorial in `index.rst` to improve logical flow and made some minor edits.
|
- Restructured the tutorial in `index.rst` to improve logical flow and made some minor edits.
|
||||||
- Updated _regex_spotify_url to ignore `/intl-<countrycode>` in Spotify links
|
- Updated _regex_spotify_url to ignore `/intl-<countrycode>` in Spotify links
|
||||||
|
- Drop support for EOL Python 3.7.
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- Fixed unused description parameter in playlist creation example
|
- Fixed unused description parameter in playlist creation example
|
||||||
- Readthedocs
|
- Readthedocs
|
||||||
|
- Corrected various grammar errors and typos in the documentation.
|
||||||
### Changed
|
|
||||||
- Drop support for EOL Python 3.7.
|
|
||||||
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- Seperated the test_current_user_save_and_usave_tracks unit test into test_current_user_save_tracks and test_current_user_unsave_tracks in the user endpoint test suite to improve unit test clarity and effectiveness for their respective user endpoints methods (current_user_saved_tracks_add, current_user_saved_tracks).
|
- Seperated the test_current_user_save_and_usave_tracks unit test into test_current_user_save_tracks and test_current_user_unsave_tracks in the user endpoint test suite to improve unit test clarity and effectiveness for their respective user endpoints methods (current_user_saved_tracks_add, current_user_saved_tracks).
|
||||||
|
|
||||||
## [2.23.0] - 2023-04-07
|
## [2.23.0] - 2023-04-07
|
||||||
@ -81,7 +77,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
- Incorrect `category_id` input for test_category
|
- Incorrect `category_id` input for test_category
|
||||||
- Assertion value for `test_categories_limit_low` and `test_categories_limit_high`
|
- Assertion value for `test_categories_limit_low` and `test_categories_limit_high`
|
||||||
- Pin Github Actions Runner to Ubuntu 20 for Py27
|
- Pin GitHub Actions Runner to Ubuntu 20 for Py27
|
||||||
- Fixed potential error where `found` variable in `test_artist_related_artists` is undefined if for loop never evaluates to true
|
- Fixed potential error where `found` variable in `test_artist_related_artists` is undefined if for loop never evaluates to true
|
||||||
- Fixed false positive test `test_new_releases` which looks up the wrong property of the JSON response object and always evaluates to true
|
- Fixed false positive test `test_new_releases` which looks up the wrong property of the JSON response object and always evaluates to true
|
||||||
|
|
||||||
@ -106,13 +102,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
### Added
|
### Added
|
||||||
|
|
||||||
- Added `RedisCacheHandler`, a cache handler that stores the token info in Redis.
|
- Added `RedisCacheHandler`, a cache handler that stores the token info in Redis.
|
||||||
- Changed URI handling in `client.Spotify._get_id()` to remove qureies if provided by error.
|
- Changed URI handling in `client.Spotify._get_id()` to remove queries if provided by error.
|
||||||
- Added a new parameter to `RedisCacheHandler` to allow custom keys (instead of the default `token_info` key)
|
- Added a new parameter to `RedisCacheHandler` to allow custom keys (instead of the default `token_info` key)
|
||||||
- Simplify check for existing token in `RedisCacheHandler`
|
- Simplify check for existing token in `RedisCacheHandler`
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- Removed Python 3.5 and added Python 3.9 in Github Action
|
- Removed Python 3.5 and added Python 3.9 in GitHub Action
|
||||||
|
|
||||||
## [2.19.0] - 2021-08-12
|
## [2.19.0] - 2021-08-12
|
||||||
|
|
||||||
@ -125,7 +121,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- Fixed a bug in `CacheFileHandler.__init__`: The documentation says that the username will be retrieved from the environment, but it wasn't.
|
- Fixed a bug in `CacheFileHandler.__init__`: The documentation says that the username will be retrieved from the environment, but it wasn't.
|
||||||
- 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 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.
|
||||||
- Use generated MIT license and fix license type in `pip show`
|
- Use generated MIT license and fix license type in `pip show`
|
||||||
|
|
||||||
## [2.18.0] - 2021-04-13
|
## [2.18.0] - 2021-04-13
|
||||||
@ -166,7 +162,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- The docs for the `auth` parameter of `Spotify.init` use the term "access token" instead of "authorization token"
|
- The docs for the `auth` parameter of `Spotify.init` use the term "access token" instead of "authorization token"
|
||||||
- Changed docs for `search` to mention that you can provide multiple types to search for
|
- Changed docs for `search` to mention that you can provide multiple types to search for
|
||||||
- The query parameters of requests are now logged
|
- The query parameters of requests are now logged
|
||||||
- Deprecate specifing `cache_path` or `username` directly to `SpotifyOAuth`, `SpotifyPKCE`, and `SpotifyImplicitGrant` constructors, instead directing users to use the `CacheFileHandler` cache handler
|
- Deprecate specifying `cache_path` or `username` directly to `SpotifyOAuth`, `SpotifyPKCE`, and `SpotifyImplicitGrant` constructors, instead directing users to use the `CacheFileHandler` cache handler
|
||||||
- Removed requirement for examples/app.py to specify port multiple times (only SPOTIPY_REDIRECT_URI needs to contain the port)
|
- Removed requirement for examples/app.py to specify port multiple times (only SPOTIPY_REDIRECT_URI needs to contain the port)
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
@ -267,7 +263,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
authorization/authentication web api errors details.
|
authorization/authentication web api errors details.
|
||||||
- Added `SpotifyStateError` subclass of `SpotifyOauthError`
|
- Added `SpotifyStateError` subclass of `SpotifyOauthError`
|
||||||
- Allow extending `SpotifyClientCredentials` and `SpotifyOAuth`
|
- Allow extending `SpotifyClientCredentials` and `SpotifyOAuth`
|
||||||
- Added the market paramter to `album_tracks`
|
- Added the market parameter to `album_tracks`
|
||||||
|
|
||||||
### Deprecated
|
### Deprecated
|
||||||
|
|
||||||
@ -318,7 +314,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- retries
|
- retries
|
||||||
- status_retries
|
- status_retries
|
||||||
- backoff_factor
|
- backoff_factor
|
||||||
- Spin up a local webserver to auto-fill authentication URL
|
- Spin up a local webserver to autofill authentication URL
|
||||||
- Use session in SpotifyAuthBase
|
- Use session in SpotifyAuthBase
|
||||||
- Logging used instead of print statements
|
- Logging used instead of print statements
|
||||||
|
|
||||||
@ -421,7 +417,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Support for `current_user_saved_albums_contains`
|
- Support for `current_user_saved_albums_contains`
|
||||||
- Support for `user_unfollow_artists`
|
- Support for `user_unfollow_artists`
|
||||||
- Support for `user_unfollow_users`
|
- Support for `user_unfollow_users`
|
||||||
- Lint with flake8 using Github action
|
- Lint with flake8 using GitHub action
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
@ -473,7 +469,7 @@ Fixed bug in auto retry logic
|
|||||||
|
|
||||||
## [2.3.3] - 2015-04-01
|
## [2.3.3] - 2015-04-01
|
||||||
|
|
||||||
Aadded client credential flow
|
Added client credential flow
|
||||||
|
|
||||||
## [2.3.2] - 2015-03-31
|
## [2.3.2] - 2015-03-31
|
||||||
|
|
||||||
@ -517,7 +513,7 @@ Support for "Your Music" tracks (add, delete, get), with examples
|
|||||||
|
|
||||||
## [1.45.0] - 2014-07-07
|
## [1.45.0] - 2014-07-07
|
||||||
|
|
||||||
Support for related artists endpoint. Don't use cache auth codes when scope changes
|
Support for related artists' endpoint. Don't use cache auth codes when scope changes
|
||||||
|
|
||||||
## [1.44.0] - 2014-07-03
|
## [1.44.0] - 2014-07-03
|
||||||
|
|
||||||
|
|||||||
12
TUTORIAL.md
12
TUTORIAL.md
@ -7,12 +7,12 @@ In order to complete this tutorial successfully, there are a few things that you
|
|||||||
**1. pip package manager**
|
**1. pip package manager**
|
||||||
|
|
||||||
You can check to see if you have pip installed by opening up Terminal and typing the following command: pip --version
|
You can check to see if you have pip installed by opening up Terminal and typing the following command: pip --version
|
||||||
If you see a version number, pip is installed and you're ready to proceed. If not, instructions for downloading the latest version of pip can be found here: https://pip.pypa.io/en/stable/cli/pip_download/
|
If you see a version number, pip is installed, and you're ready to proceed. If not, instructions for downloading the latest version of pip can be found here: https://pip.pypa.io/en/stable/cli/pip_download/
|
||||||
|
|
||||||
|
|
||||||
**2. python3**
|
**2. python3**
|
||||||
|
|
||||||
Spotipy is written in Python, so you'll need to have the lastest version of Python installed in order to use Spotipy. Check if you already have Python installed with the Terminal command: python --version
|
Spotipy is written in Python, so you'll need to have the latest version of Python installed in order to use Spotipy. Check if you already have Python installed with the Terminal command: python --version
|
||||||
If you see a version number, Python is already installed. If not, you can download it here: https://www.python.org/downloads/
|
If you see a version number, Python is already installed. If not, you can download it here: https://www.python.org/downloads/
|
||||||
|
|
||||||
**3. spotipy**
|
**3. spotipy**
|
||||||
@ -37,13 +37,13 @@ B. Click the "Create an App" button. Enter any name and description you'd like f
|
|||||||
|
|
||||||
C. In your new app's Overview screen, click the "Edit Settings" button and scroll down to "Redirect URIs." Add "http://localhost:1234" (or any other port number of your choosing). Hit the "Save" button at the bottom of the Settings panel to return to you App Overview screen.
|
C. In your new app's Overview screen, click the "Edit Settings" button and scroll down to "Redirect URIs." Add "http://localhost:1234" (or any other port number of your choosing). Hit the "Save" button at the bottom of the Settings panel to return to you App Overview screen.
|
||||||
|
|
||||||
D. Underneath your app name and description on the lefthand side, you'll see a "Show Client Secret" link. Click that link to reveal your Client Secret, then copy both your Client Secret and your Client ID somewhere on your computer. You'll need to access them later.
|
D. Underneath your app name and description on the left-hand side, you'll see a "Show Client Secret" link. Click that link to reveal your Client Secret, then copy both your Client Secret and your Client ID somewhere on your computer. You'll need to access them later.
|
||||||
|
|
||||||
## Step 2. Installation and Setup
|
## Step 2. Installation and Setup
|
||||||
|
|
||||||
A. Create a folder somewhere on your computer where you'd like to store the code for your Spotipy app. You can create a folder in terminal with this command: mkdir folder_name
|
A. Create a folder somewhere on your computer where you'd like to store the code for your Spotipy app. You can create a folder in terminal with this command: mkdir folder_name
|
||||||
|
|
||||||
B. In that folder, create a Python file named main.py. You can create the file directly from Terminal using a built in text editor like Vim, which comes preinstalled on Linux operating systems. To create the file with Vim, ensure that you are in your new directory, then run: vim main.py
|
B. In that folder, create a Python file named main.py. You can create the file directly from Terminal using a built-in text editor like Vim, which comes preinstalled on Linux operating systems. To create the file with Vim, ensure that you are in your new directory, then run: vim main.py
|
||||||
|
|
||||||
C. Paste the following code into your main.py file:
|
C. Paste the following code into your main.py file:
|
||||||
```
|
```
|
||||||
@ -61,11 +61,11 @@ D. Replace YOUR_APP_CLIENT_ID and YOUR_APP_CLIENT_SECRET with the values you cop
|
|||||||
|
|
||||||
After completing steps 1 and 2, your app is fully configured and ready to fetch data from the Spotify API. All that's left is to tell the API what data we're looking for, and we do that by adding some additional code to main.py. The code that follows is just an example - once you get it working, you should feel free to modify it in order to get different results.
|
After completing steps 1 and 2, your app is fully configured and ready to fetch data from the Spotify API. All that's left is to tell the API what data we're looking for, and we do that by adding some additional code to main.py. The code that follows is just an example - once you get it working, you should feel free to modify it in order to get different results.
|
||||||
|
|
||||||
For now, let's assume that we want to print the names of all of the albums on Spotify by Taylor Swift:
|
For now, let's assume that we want to print the names of all the albums on Spotify by Taylor Swift:
|
||||||
|
|
||||||
A. First, we need to find Taylor Swift's Spotify URI (Uniform Resource Indicator). Every entity (artist, album, song, etc.) has a URI that can identify it. To find Taylor's URI, navigate to [her page on Spotify](https://open.spotify.com/artist/06HL4z0CvFAxyc27GXpf02) and look at the URI in your browser. Everything there that follows the last backslash in the URL path is Taylor's URI, in this case: 06HL4z0CvFAxyc27GXpf02
|
A. First, we need to find Taylor Swift's Spotify URI (Uniform Resource Indicator). Every entity (artist, album, song, etc.) has a URI that can identify it. To find Taylor's URI, navigate to [her page on Spotify](https://open.spotify.com/artist/06HL4z0CvFAxyc27GXpf02) and look at the URI in your browser. Everything there that follows the last backslash in the URL path is Taylor's URI, in this case: 06HL4z0CvFAxyc27GXpf02
|
||||||
|
|
||||||
B. Add the URI as a variable in main.py. Notice the prefix added the the URI:
|
B. Add the URI as a variable in main.py. Notice the prefix added the URI:
|
||||||
```
|
```
|
||||||
taylor_uri = 'spotify:artist:06HL4z0CvFAxyc27GXpf02'
|
taylor_uri = 'spotify:artist:06HL4z0CvFAxyc27GXpf02'
|
||||||
```
|
```
|
||||||
|
|||||||
@ -11,7 +11,7 @@ Prerequisites
|
|||||||
OPTIONAL
|
OPTIONAL
|
||||||
// in development environment for debug output
|
// in development environment for debug output
|
||||||
export FLASK_ENV=development
|
export FLASK_ENV=development
|
||||||
// so that you can invoke the app outside of the file's directory include
|
// so that you can invoke the app outside the file's directory include
|
||||||
export FLASK_APP=/path/to/spotipy/examples/app.py
|
export FLASK_APP=/path/to/spotipy/examples/app.py
|
||||||
|
|
||||||
// on Windows, use `SET` instead of `export`
|
// on Windows, use `SET` instead of `export`
|
||||||
|
|||||||
@ -100,7 +100,7 @@ class Spotify:
|
|||||||
#
|
#
|
||||||
# Unfortunately the IANA specification is out of date and doesn't include the new types
|
# Unfortunately the IANA specification is out of date and doesn't include the new types
|
||||||
# show and episode. Additionally, for the user URI, it does not specify which characters
|
# show and episode. Additionally, for the user URI, it does not specify which characters
|
||||||
# are valid for usernames, so the assumption is alphanumeric which coincidentially are also
|
# are valid for usernames, so the assumption is alphanumeric which coincidentally are also
|
||||||
# the same ones base-62 uses.
|
# the same ones base-62 uses.
|
||||||
# In limited manual exploration this seems to hold true, as newly accounts are assigned an
|
# In limited manual exploration this seems to hold true, as newly accounts are assigned an
|
||||||
# identifier that looks like the base-62 of all other IDs, but some older accounts only have
|
# identifier that looks like the base-62 of all other IDs, but some older accounts only have
|
||||||
@ -1751,7 +1751,7 @@ class Spotify:
|
|||||||
tlist = [self._get_id("track", t) for t in tracks]
|
tlist = [self._get_id("track", t) for t in tracks]
|
||||||
results = self._get("audio-features/?ids=" + ",".join(tlist))
|
results = self._get("audio-features/?ids=" + ",".join(tlist))
|
||||||
# the response has changed, look for the new style first, and if
|
# the response has changed, look for the new style first, and if
|
||||||
# its not there, fallback on the old style
|
# it's not there, fallback on the old style
|
||||||
if "audio_features" in results:
|
if "audio_features" in results:
|
||||||
return results["audio_features"]
|
return results["audio_features"]
|
||||||
else:
|
else:
|
||||||
@ -1939,7 +1939,7 @@ class Spotify:
|
|||||||
def add_to_queue(self, uri, device_id=None):
|
def add_to_queue(self, uri, device_id=None):
|
||||||
""" Adds a song to the end of a user's queue
|
""" Adds a song to the end of a user's queue
|
||||||
|
|
||||||
If device A is currently playing music and you try to add to the queue
|
If device A is currently playing music, and you try to add to the queue
|
||||||
and pass in the id for device B, you will get a
|
and pass in the id for device B, you will get a
|
||||||
'Player command failed: Restriction violated' error
|
'Player command failed: Restriction violated' error
|
||||||
I therefore recommend leaving device_id as None so that the active device is targeted
|
I therefore recommend leaving device_id as None so that the active device is targeted
|
||||||
|
|||||||
@ -41,7 +41,7 @@ class SpotifyStateError(SpotifyOauthError):
|
|||||||
def __init__(self, local_state=None, remote_state=None, message=None,
|
def __init__(self, local_state=None, remote_state=None, message=None,
|
||||||
error=None, error_description=None, *args, **kwargs):
|
error=None, error_description=None, *args, **kwargs):
|
||||||
if not message:
|
if not message:
|
||||||
message = ("Expected " + local_state + " but recieved "
|
message = ("Expected " + local_state + " but received "
|
||||||
+ remote_state)
|
+ remote_state)
|
||||||
super(SpotifyOauthError, self).__init__(message, error,
|
super(SpotifyOauthError, self).__init__(message, error,
|
||||||
error_description, *args,
|
error_description, *args,
|
||||||
@ -310,7 +310,7 @@ class SpotifyOAuth(SpotifyAuthBase):
|
|||||||
* requests_session: A Requests session
|
* requests_session: A Requests session
|
||||||
* requests_timeout: Optional, tell Requests to stop waiting for a response after
|
* requests_timeout: Optional, tell Requests to stop waiting for a response after
|
||||||
a given number of seconds
|
a given number of seconds
|
||||||
* open_browser: Optional, whether or not the web browser should be opened to
|
* open_browser: Optional, whether the web browser should be opened to
|
||||||
authorize a user
|
authorize a user
|
||||||
* cache_handler: An instance of the `CacheHandler` class to handle
|
* cache_handler: An instance of the `CacheHandler` class to handle
|
||||||
getting and saving cached authorization tokens.
|
getting and saving cached authorization tokens.
|
||||||
@ -659,7 +659,7 @@ class SpotifyPKCE(SpotifyAuthBase):
|
|||||||
* requests_timeout: Optional, tell Requests to stop waiting for a response after
|
* requests_timeout: Optional, tell Requests to stop waiting for a response after
|
||||||
a given number of seconds
|
a given number of seconds
|
||||||
* requests_session: A Requests session
|
* requests_session: A Requests session
|
||||||
* open_browser: Optional, whether or not the web browser should be opened to
|
* open_browser: Optional, whether the web browser should be opened to
|
||||||
authorize a user
|
authorize a user
|
||||||
* cache_handler: An instance of the `CacheHandler` class to handle
|
* cache_handler: An instance of the `CacheHandler` class to handle
|
||||||
getting and saving cached authorization tokens.
|
getting and saving cached authorization tokens.
|
||||||
@ -995,7 +995,7 @@ class SpotifyImplicitGrant(SpotifyAuthBase):
|
|||||||
Authentication Code flow. Use the SpotifyPKCE auth manager instead
|
Authentication Code flow. Use the SpotifyPKCE auth manager instead
|
||||||
of SpotifyImplicitGrant.
|
of SpotifyImplicitGrant.
|
||||||
|
|
||||||
SpotifyPKCE contains all of the functionality of
|
SpotifyPKCE contains all the functionality of
|
||||||
SpotifyImplicitGrant, plus automatic response retrieval and
|
SpotifyImplicitGrant, plus automatic response retrieval and
|
||||||
refreshable tokens. Only a few replacements need to be made:
|
refreshable tokens. Only a few replacements need to be made:
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user