A Python program that scrapes data on the top 100 songs from a specified, given by user, date using web scraping techniques, then creates a Spotify playlist. Additionally, the script requires certain credentials to be included in the env
file, allowing the user to run the script with their Spotify API details.
Before running the program, make sure you have the following installed:
- Python 3.x
- Pip (Python package installer)
-
Clone the repository:
git clone https://github.com/hidoominik/spotify-playlist-generator.git
-
Navigate to the project directory:
cd spotify-playlist-generator
-
Install the required dependencies:
pip install -r requirements.txt
Follow these steps to set up your Spotify API credentials:
-
Create a Spotify Developer Account:
- Visit the Spotify Developer Dashboard.
- Log in or create a new Spotify account.
-
Create a New Application:
- Once logged in, click on the "Create an App" button.
- Fill in the required information to create your application.
- Note: This information is necessary to obtain the
client_id
andclient_secret
for authentication.
-
Set Up a Redirect URI:
- After creating the application, go to the "Edit Settings" page.
- Add a Redirect URI. This is the URI where Spotify will redirect after the user grants/denies permission.
- Make sure the Redirect URI matches the one set in the
env
file.
-
Create
env
File:-
In the project directory, create a file named
.env
(if not already present). -
You can use
.env-template
file as a... template. -
Add the following content to the file, replacing placeholders with your actual Spotify API credentials:
SPOTIPY_CLIENT_ID = your_client_id SPOTIPY_CLIENT_SECRET = your_client_secret SPOTIPY_USERNAME = your_spotify_username SPOTIPY_REDIRECT_URI = your_redirect_uri
Replace
your_client_id
,your_client_secret
,your_spotify_username
, andyour_redirect_uri
with the corresponding credentials obtained from the Spotify Developer Dashboard.
-
Now, your Spotify API credentials are configured, and the program is ready to be run.