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:
Mason Stephenson 2022-12-10 10:27:29 -06:00 committed by GitHub
parent 1377879972
commit edd3f29a2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 0 deletions

View File

@ -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

View File

@ -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

View 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'])

View File

@ -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