mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-06-19 09:13:53 +00:00
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:
parent
a7dfda54d3
commit
c927f02c1c
@ -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
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
10
FAQ.md
10
FAQ.md
@ -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:
|
||||
|
||||
@ -33,3 +33,11 @@ Solution:
|
||||
|
||||
- You are likely missing a scope when requesting the endpoint, check
|
||||
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
README.md
26
README.md
@ -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']):
|
||||
|
||||
2
setup.py
2
setup.py
@ -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",
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user