Skip to content

Commit

Permalink
Getting Started Clarifications and Example Code File (#904)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
masstep authored Dec 10, 2022
1 parent 1377879 commit edd3f29
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

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

- Update contributing.md
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ Spotipy's full documentation is online at [Spotipy Documentation](http://spotipy
pip install spotipy
```

alternatively, for Windows users

```bash
py -m pip install spotipy
```

or upgrade

```bash
Expand Down Expand Up @@ -43,6 +49,8 @@ for idx, track in enumerate(results['tracks']['items']):

### 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
import spotipy
from spotipy.oauth2 import SpotifyOAuth
Expand Down
13 changes: 13 additions & 0 deletions examples/playlist_add_items.py
Original file line number Diff line number Diff line change
@@ -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 change: 1 addition & 0 deletions examples/show_artist_top_tracks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# shows artist info for a URN or URL
# scope is not required for this function

from spotipy.oauth2 import SpotifyClientCredentials
import spotipy
Expand Down

0 comments on commit edd3f29

Please sign in to comment.