Skip to content

Commit

Permalink
adding comment header and links to relevant docs in example files
Browse files Browse the repository at this point in the history
  • Loading branch information
neilnautiyal committed Nov 4, 2023
1 parent f7e1337 commit 01e22a1
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 4 deletions.
7 changes: 5 additions & 2 deletions examples/add_a_saved_album.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# code example that demonstrates current_user_saved_albums_add(albums=[]) functionality
# Link to documentation -> https://spotipy.readthedocs.io/en/2.22.1/#spotipy.client.Spotify.current_user_saved_albums_add

import argparse
import logging

Expand All @@ -16,11 +19,11 @@ def get_args():
required=True, help='Album ids')
return parser.parse_args()

# TODO

def main():
args = get_args()
sp = spotipy.Spotify(auth_manager=SpotifyOAuth(scope=scope))
sp.current_user_saved_albums_add(albums=args.aids)
sp.current_user_saved_albums_add(albums=args.aids)


if __name__ == '__main__':
Expand Down
3 changes: 3 additions & 0 deletions examples/add_a_saved_track.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# code example that demonstrates current_user_saved_tracks_add(tracks=None) functionality
# Link to documentation -> https://spotipy.readthedocs.io/en/2.22.1/#spotipy.client.Spotify.current_user_saved_tracks_add

import argparse
import logging

Expand Down
3 changes: 3 additions & 0 deletions examples/add_tracks_to_playlist.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# code example that demonstrates playlist_add_items(playlist_id, items, position=None) functionality
# Link to documentation -> https://spotipy.readthedocs.io/en/2.22.1/#spotipy.client.Spotify.playlist_add_items

import argparse
import logging

Expand Down
4 changes: 2 additions & 2 deletions examples/audio_features_for_track.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@


# code example that demonstrates audio_features(tracks=[]) functionality
# Link to documentation -> https://spotipy.readthedocs.io/en/2.22.1/#spotipy.client.Spotify.audio_features
# shows acoustic features for tracks for the given artist

from __future__ import print_function # (at top of module)
Expand Down
2 changes: 2 additions & 0 deletions examples/contains_a_saved_track.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# code example that demonstrates current_user_saved_tracks_contains(tracks=None) functionality
# Link to documentation -> https://spotipy.readthedocs.io/en/2.22.1/#spotipy.client.Spotify.current_user_saved_tracks_contains
# Prints whether a track exists in your collection of saved tracks

import pprint
Expand Down
2 changes: 2 additions & 0 deletions examples/create_playlist.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# code example that demonstrates user_playlist_create(user, name, public=True, collaborative=False, description='') functionality
# Link to documentation -> https://spotipy.readthedocs.io/en/2.22.1/#spotipy.client.Spotify.user_playlist_create
# Creates a playlist for a user

import argparse
Expand Down
2 changes: 2 additions & 0 deletions examples/delete_a_saved_track.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# code example that demonstrates current_user_saved_tracks_delete(tracks=None) functionality
# Link to documentation -> https://spotipy.readthedocs.io/en/2.22.1/#spotipy.client.Spotify.current_user_saved_tracks_delete
# Delete a track from 'Your Collection' of saved tracks

import pprint
Expand Down
3 changes: 3 additions & 0 deletions examples/follow_playlist.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# code example that demonstrates current_user_follow_playlist(playlist_id) functionality
# Link to documentation -> https://spotipy.readthedocs.io/en/2.22.1/#spotipy.client.Spotify.current_user_follow_playlist

import argparse

import spotipy
Expand Down
2 changes: 2 additions & 0 deletions examples/my_playlists.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# code example that demonstrates current_user_playlists(limit=50, offset=0) functionality
# Link to documentation -> https://spotipy.readthedocs.io/en/2.22.1/#spotipy.client.Spotify.current_user_playlists
# Shows a user's playlists

import spotipy
Expand Down
2 changes: 2 additions & 0 deletions examples/my_top_artists.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# code example that demonstrates current_user_top_artists(limit=20, offset=0, time_range='medium_term') functionality
# Link to documentation -> https://spotipy.readthedocs.io/en/2.22.1/#spotipy.client.Spotify.current_user_top_artists
# Shows the top artists for a user
import spotipy
from spotipy.oauth2 import SpotifyOAuth
Expand Down

0 comments on commit 01e22a1

Please sign in to comment.