- Application can take any block of text
- It creates a playlist of Spotify tracks using the Spotify API.
- Input to the application is provided in the form of command line arguments, if not provided script will prompt the user to provide a text query
- pip install spotipy
- Create a spotify application from the url :
https://developer.spotify.com/my-applications/#!/applications/create
- Retrieve client ID, client Secret from the App.
- create_spotify_playlist.py:
- Main class file
- reads user input -> parses input -> authorizes spotify -> search for tracks
- Provide the above fetch client id & secret key to the global variables created in class MyTrack
- client_id = " "
- client_secret = " "
- Following will give examples on how to execute the above script:
-
help on arguments: python create_spotify_playlist.py -h
-
Eg 1: python create_spotify_playlist.py "if i can't let it go out of my mind"
-
Eg 2: python create_spotify_playlist.py
- when no argument provided the script will prompt user to enter the input (shown below)
- please enter query string here : if i can't let it go out of my mind
-
-
test_end_to_end.py
- Performs end to end testing of the application
- execution: python test_end_to_end.py
-
test_unitest.py
- Performs unittest
- execution: python test_unitest.py
- Splits the user input into short text of size 3 or more
- filter duplicate tracks