This Python script creates a Spotify playlist from a CSV file using the Spotify Web API.
Before you begin, ensure you have met the following requirements:
- You have a Spotify account.
- You have registered an application on the Spotify Developer Dashboard and have your Client ID, Client Secret, and Redirect URI.
- You have installed Python 3 and pip.
To install Spotify Playlist Creator, follow these steps:
- Install the
spotipylibrary by running the following command in your terminal:
pip install spotipy- Clone this repository or download the script to your local machine.
To use Spotify Playlist Creator, follow these steps:
- Copy
config.py.distintoconfig.py - Open
config.py - Replace
'your-spotify-client-id','your-spotify-client-secret','your-spotify-redirect-uri', and'your-spotify-user-id'with your actual Spotify Client ID, Client Secret, Redirect URI, and User ID. - Save and close the script.
- Insert songs in
songs.csvfile (preferably use ChatGPT for recomendations) - Run the script in your terminal with the
--nameargument to specify the playlist name, like this:
python3 playlistFromCsv.py --name PLAYLIST_NAMEReplace PLAYLIST_NAME with the actual name you want for the playlist.
-
You'll be redirected to the Spotify website to log in and authorize the application. After authorizing the application, you'll be redirected to your Redirect URI. Copy the URL from your browser's address bar and paste it into your terminal.
-
The script will create a new playlist with the specified name and add the songs from the CSV file to the playlist.
- ChatGPT-4
- Jan Żaba
If you want to contact me, you can reach me at janekzaba@gmail.com.