mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-06-19 09:13:53 +00:00
Getting Started Clarifications and Example Code File (#904)
* added URI link to README getting started * revised comment * added alternate module installation instruction * installation troubleshooting comment * scope clarification comment * added playlist_add_items.py to examples folder * reformatted changelog edits * Relocated added contributions to added section in Changelog * removed unnecessary library installation instruction * Clarified alternative installation instruction
This commit is contained in:
parent
1377879972
commit
edd3f29a2c
@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
|
- Add alternative module installation instruction to README
|
||||||
|
- Added Comment to README - Getting Started for user to add URI to app in Spotify Developer Dashboard.
|
||||||
|
- Added playlist_add_tracks.py to example folder
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- Update contributing.md
|
- Update contributing.md
|
||||||
|
|||||||
@ -14,6 +14,12 @@ Spotipy's full documentation is online at [Spotipy Documentation](http://spotipy
|
|||||||
pip install spotipy
|
pip install spotipy
|
||||||
```
|
```
|
||||||
|
|
||||||
|
alternatively, for Windows users
|
||||||
|
|
||||||
|
```bash
|
||||||
|
py -m pip install spotipy
|
||||||
|
```
|
||||||
|
|
||||||
or upgrade
|
or upgrade
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@ -43,6 +49,8 @@ for idx, track in enumerate(results['tracks']['items']):
|
|||||||
|
|
||||||
### With user authentication
|
### With user authentication
|
||||||
|
|
||||||
|
A redirect URI must be added to your application at [My Dashboard](https://developer.spotify.com/dashboard/applications) to access user authenticated features.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
import spotipy
|
import spotipy
|
||||||
from spotipy.oauth2 import SpotifyOAuth
|
from spotipy.oauth2 import SpotifyOAuth
|
||||||
|
|||||||
13
examples/playlist_add_items.py
Normal file
13
examples/playlist_add_items.py
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# Add a list of items (URI) to a playlist (URI)
|
||||||
|
|
||||||
|
import spotipy
|
||||||
|
from spotipy.oauth2 import SpotifyOAuth
|
||||||
|
|
||||||
|
sp = spotipy.Spotify(auth_manager=SpotifyOAuth(client_id="YOUR_APP_CLIENT_ID",
|
||||||
|
client_secret="YOUR_APP_CLIENT_SECRET",
|
||||||
|
redirect_uri="YOUR_APP_REDIRECT_URI",
|
||||||
|
scope="playlist-modify-private"
|
||||||
|
))
|
||||||
|
|
||||||
|
sp.playlist_add_items('playlist_id', ['list_of_items'])
|
||||||
|
|
||||||
@ -1,4 +1,5 @@
|
|||||||
# shows artist info for a URN or URL
|
# shows artist info for a URN or URL
|
||||||
|
# scope is not required for this function
|
||||||
|
|
||||||
from spotipy.oauth2 import SpotifyClientCredentials
|
from spotipy.oauth2 import SpotifyClientCredentials
|
||||||
import spotipy
|
import spotipy
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user