Skip to content

Commit

Permalink
Bump to 2.14.0 (#565)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
stephanebruckert authored Aug 29, 2020
1 parent a7dfda5 commit c927f02
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 26 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 10 additions & 2 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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")`.
26 changes: 7 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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']):
Expand All @@ -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']):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

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",
Expand Down
7 changes: 6 additions & 1 deletion spotipy/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ def search(self, q, limit=10, offset=0, type="track", market=None):
)

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
Expand All @@ -553,6 +553,11 @@ def search_markets(self, q, limit=10, offset=0, type="track", markets=None, tota
- 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

Expand Down

0 comments on commit c927f02

Please sign in to comment.