Bump to 2.14.0 (#565)

* Add missing changelog entries

* Mark search_markets as experimental

* Bump to 2.14.0

* Improve FAQ, closes #522

* Remove non-beginner friendly exports from README, closes #521
This commit is contained in:
Stéphane Bruckert 2020-08-29 13:00:49 +01:00 committed by GitHub
parent a7dfda54d3
commit c927f02c1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 32 additions and 26 deletions

View File

@ -7,10 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased
// Add your changes here and then delete this line
## [2.14.0] - 2020-08-29
### Added
- Support to search multiple markets at once.
- Support to search all available Spotify markets.
- (experimental) Support to search multiple/all markets at once.
- Support to test whether the current user is following certain
users or artists
- Proper replacements for all deprecated playlist endpoints
@ -21,6 +24,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Support to advertise different language to Spotify
- Added 'collaborative' parameter to user_playlist_create method.
- Enforce CHANGELOG update on PR
- Adds `additional_types` parameter to retrieve currently playing podcast episode
- Support to get info about a single category
### Deprecated

View File

@ -31,6 +31,6 @@ To verify the code style:
pip install flake8
flake8 .
### README
### Changelog
Don't forget to add a short description of your change in the [CHANGELOG](CHANGELOG.md)

12
FAQ.md
View File

@ -22,7 +22,7 @@ Solution:
- Request a new token by adding `show_dialog=True` to `spotipy.Spotify(auth_manager=SpotifyOAuth(show_dialog=True))`
- Check that `spotipy.me()` shows the correct user id
### 401 Unauthorized
### Why do I get 401 Unauthorized?
Error:
@ -32,4 +32,12 @@ Error:
Solution:
- You are likely missing a scope when requesting the endpoint, check
https://developer.spotify.com/web-api/using-scopes/
https://developer.spotify.com/web-api/using-scopes/
### Search doesn't find some tracks
Problem: you can see a track on the Spotify app but searching for it using the API doesn't find it.
Solution: by default `search("abba")` works in the US market.
To search for in your current country, the [country indicator](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
must be specified: `search("abba", market="DE")`.

View File

@ -29,18 +29,12 @@ Add your new ID and SECRET to your environment:
### Without user authentication
```bash
export SPOTIPY_CLIENT_ID=client_id_here
export SPOTIPY_CLIENT_SECRET=client_secret_here
// on Windows, use `SET` instead of `export`
```
```python
import spotipy
from spotipy.oauth2 import SpotifyClientCredentials
sp = spotipy.Spotify(auth_manager=SpotifyClientCredentials())
sp = spotipy.Spotify(auth_manager=SpotifyClientCredentials(client_id="YOUR_APP_CLIENT_ID",
client_secret="YOUR_APP_CLIENT_SECRET"))
results = sp.search(q='weezer', limit=20)
for idx, track in enumerate(results['tracks']['items']):
@ -49,21 +43,15 @@ for idx, track in enumerate(results['tracks']['items']):
### With user authentication
```bash
export SPOTIPY_CLIENT_ID=client_id_here
export SPOTIPY_CLIENT_SECRET=client_secret_here
export SPOTIPY_REDIRECT_URI=redirect_uri_here
// on Windows, use `SET` instead of `export`
```
```python
import spotipy
from spotipy.oauth2 import SpotifyOAuth
scope = "user-library-read"
sp = spotipy.Spotify(auth_manager=SpotifyOAuth(scope=scope))
sp = spotipy.Spotify(auth_manager=SpotifyOAuth(client_id="YOUR_APP_CLIENT_ID",
client_secret="YOUR_APP_CLIENT_SECRET",
redirect_uri="YOUR_APP_REDIRECT_URI",
username="YOUR_SPOTIFY_USERNAME",
scope="user-library-read"))
results = sp.current_user_saved_tracks()
for idx, item in enumerate(results['items']):

View File

@ -18,7 +18,7 @@ extra_reqs = {
setup(
name='spotipy',
version='2.13.0',
version='2.14.0',
description='A light weight Python library for the Spotify Web API',
long_description=long_description,
long_description_content_type="text/markdown",

View File

@ -539,7 +539,7 @@ class Spotify(object):
)
def search_markets(self, q, limit=10, offset=0, type="track", markets=None, total=None):
""" searches multple markets for an item
""" (experimental) Searches multiple markets for an item
Parameters:
- q - the search query (see how to write a query in the
@ -553,6 +553,11 @@ class Spotify(object):
- total - the total number of results to return if multiple markets are supplied in the search.
If multiple types are specified, this only applies to the first type.
"""
warnings.warn(
"Searching multiple markets is an experimental feature. "
"Please be aware that this method's inputs and outputs can change in the future.",
UserWarning,
)
if not markets:
markets = self.country_codes