-
Notifications
You must be signed in to change notification settings - Fork 263
Spotify playlist generator #140
Spotify playlist generator #140
Conversation
@AdityaJ7 Can you please review this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please comment your code everything else looks good to me
@AdityaJ7 Added comments, can you please merge the PR? |
Will be merged automatically when two approved reviews are received |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove unnecessary blank lines from the code?
Also, add id, a playlist for testing purposes.
1. [Create Spotify Developers Account and create a new app](https://developer.spotify.com/) | ||
2. Export Client Id, Client Secret and Redirect URI | ||
* `export SPOTIPY_CLIENT_ID='your-spotify-client-id'` | ||
* `export SPOTIPY_CLIENT_SECRET='your-spotify-client-secret'` | ||
* `export SPOTIPY_REDIRECT_URI='your-app-redirect-url'` | ||
3. `python main.py -p [playlist_id] -l [size_of_each_playlist]` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! Can you add a test id and playlist? For viewers to test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! I don't have a test account on Spotify, i tested these on my personal account.
|
||
### Screenshot/GIF showing the sample use of the script | ||
<!--Remove the below lines and add yours --> | ||
 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove /
 | |
 |
spotipy_instance = spotipy.Spotify(auth_manager=SpotifyOAuth(scope=scope, cache_path=os.getcwd())) | ||
|
||
|
||
# Method to read the command line arguments and parse them |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of adding comments outside from functions make doc string inside in functions
# Method to read the command line arguments and parse them | |
def get_args(): | |
"""Method to read the command line arguments and parse them | |
Input: | |
Output: | |
""" |
def get_track_ids_for_playlist(playlist): | ||
res = [] | ||
for song in playlist: | ||
#Extract the ID of the track |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when you are writing single line command use after you statement
#Extract the ID of the track | |
res.append(song['track']['id']) # Extract the ID of the track |
# This method generates smaller playlists from the input playlist | ||
def generate_playlists(playlist_size, playlist_songs, user_id): | ||
# Create the smaller playlists from the given large playlist | ||
smaller_playlists = [playlist_songs[x:x + playlist_size] for x in range(0, len(playlist_songs), playlist_size)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Limit all lines to a maximum of 79 characters.
smaller_playlists = [playlist_songs[x:x + playlist_size] for x in range(0, len(playlist_songs), playlist_size)] | |
smaller_playlists = [playlist_songs[x:x + playlist_size] for x in | |
range(0, len(playlist_songs), playlist_size)] |
Are you working on it? @sandyjswl |
Hi, I'll fix the changes tommorow. I won't be able to the ID and Playlist because I don't to expose my personal playlist. But I can make the other changes. |
@tusharnankani @AdityaJ7 Can you merge this now? |
@allcontributors please add @sandyjswl for code |
I've put up a pull request to add @sandyjswl! 🎉 |
Python World does not accept pull requests on this repository anymore. |
Spotify Playlist Generator
Generate multiple playlists of a given size from a large Spotify playlist.
Fixes (#140 )
Type of change
Choosing one or more options from the following as per the nature of your Pull request.
NOTE: These boxes can be checked using
[X]
Bug fix (non-breaking change which fixes an issue)
New feature (non-breaking change which adds functionality)
Documentation Update
Checklist:
Please tick all the boxes that are fulfilled by your Pull Request.
Update index.md
)README.md
, according to the givenREADME_TEMPLATE.