Skip to content

Commit b2fe96b

Browse files
ashutosh dasashutosh das
authored andcommitted
Customizable Workout Playlist Generator
1 parent 8c6ae32 commit b2fe96b

File tree

4 files changed

+671
-0
lines changed

4 files changed

+671
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Customizable Workout Playlist Generator
2+
3+
This Python application generates customized workout playlists based on user preferences, including workout type, duration, preferred genres, and BPM range. It can use a local song database or integrate with popular music streaming services like Spotify, Apple Music, and YouTube Music.
4+
5+
## Features
6+
7+
- Generate playlists for various workout types (e.g., HIIT, yoga, cardio)
8+
- Customize playlist duration
9+
- Filter songs by genre and BPM range
10+
- Integration with Spotify, Apple Music, and YouTube Music (API keys required)
11+
- Save and load playlists in JSON format
12+
13+
## Requirements
14+
15+
- Python 3.6+
16+
- Required Python packages (see `requirements.txt`)
17+
18+
## Installation
19+
20+
1. Clone this repository:
21+
```
22+
git clone https://github.com/Ashutoshdas-dev/All-In-One-Python-Projects.git
23+
cd Customizable_Workout_Playlist_Generator
24+
```
25+
26+
2. Install the required packages:
27+
```
28+
pip install -r requirements.txt
29+
```
30+
31+
3. Set up API credentials for the music services you want to use (Spotify, Apple Music, or YouTube Music).
32+
33+
## Usage
34+
35+
1. Run the main script:
36+
```
37+
python playlist.py
38+
```
39+
40+
2. Follow the prompts to:
41+
- Choose a music source (local database, Spotify, Apple Music, or YouTube Music)
42+
- Enter workout type, duration, preferred genres, and BPM range
43+
- Generate and view the playlist
44+
- Save the playlist to a JSON file (optional)
45+
46+
3. Repeat the process to generate multiple playlists or exit the program.
47+
48+
## API Integration
49+
50+
To use the music streaming service integrations, you'll need to set up API credentials:
51+
52+
- Spotify: Set up a Spotify Developer account and create an app to get your client ID and client secret.
53+
- Apple Music: Obtain an Apple Developer account and set up MusicKit.
54+
- YouTube Music: No authentication is required for basic usage.
55+
56+
Update the respective client classes in `playlist.py` with your API credentials.
Lines changed: 317 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,317 @@
1+
[
2+
{
3+
"title": "Lose Yourself",
4+
"artist": "Eminem",
5+
"duration": 326,
6+
"bpm": 171,
7+
"genre": "hip-hop"
8+
},
9+
{
10+
"title": "Till I Collapse",
11+
"artist": "Eminem",
12+
"duration": 297,
13+
"bpm": 171,
14+
"genre": "hip-hop"
15+
},
16+
{
17+
"title": "God's Plan",
18+
"artist": "Drake",
19+
"duration": 198,
20+
"bpm": 154,
21+
"genre": "hip-hop"
22+
},
23+
{
24+
"title": "Blinding Lights",
25+
"artist": "The Weeknd",
26+
"duration": 200,
27+
"bpm": 171,
28+
"genre": "pop"
29+
},
30+
{
31+
"title": "Sicko Mode",
32+
"artist": "Travis Scott",
33+
"duration": 312,
34+
"bpm": 155,
35+
"genre": "hip-hop"
36+
},
37+
{
38+
"title": "In the End",
39+
"artist": "Linkin Park",
40+
"duration": 217,
41+
"bpm": 105,
42+
"genre": "rock"
43+
},
44+
{
45+
"title": "HUMBLE.",
46+
"artist": "Kendrick Lamar",
47+
"duration": 177,
48+
"bpm": 150,
49+
"genre": "hip-hop"
50+
},
51+
{
52+
"title": "Shape of You",
53+
"artist": "Ed Sheeran",
54+
"duration": 233,
55+
"bpm": 96,
56+
"genre": "pop"
57+
},
58+
{
59+
"title": "Rockstar",
60+
"artist": "Post Malone",
61+
"duration": 218,
62+
"bpm": 80,
63+
"genre": "hip-hop"
64+
},
65+
{
66+
"title": "Senorita",
67+
"artist": "Shawn Mendes",
68+
"duration": 190,
69+
"bpm": 117,
70+
"genre": "pop"
71+
},
72+
{
73+
"title": "Bad Guy",
74+
"artist": "Billie Eilish",
75+
"duration": 194,
76+
"bpm": 135,
77+
"genre": "pop"
78+
},
79+
{
80+
"title": "Believer",
81+
"artist": "Imagine Dragons",
82+
"duration": 204,
83+
"bpm": 125,
84+
"genre": "rock"
85+
},
86+
{
87+
"title": "Old Town Road",
88+
"artist": "Lil Nas X",
89+
"duration": 157,
90+
"bpm": 136,
91+
"genre": "hip-hop"
92+
},
93+
{
94+
"title": "7 Rings",
95+
"artist": "Ariana Grande",
96+
"duration": 178,
97+
"bpm": 70,
98+
"genre": "pop"
99+
},
100+
{
101+
"title": "Sunflower",
102+
"artist": "Post Malone",
103+
"duration": 158,
104+
"bpm": 90,
105+
"genre": "hip-hop"
106+
},
107+
{
108+
"title": "No Tears Left to Cry",
109+
"artist": "Ariana Grande",
110+
"duration": 206,
111+
"bpm": 122,
112+
"genre": "pop"
113+
},
114+
{
115+
"title": "Lucid Dreams",
116+
"artist": "Juice WRLD",
117+
"duration": 239,
118+
"bpm": 84,
119+
"genre": "hip-hop"
120+
},
121+
{
122+
"title": "Memories",
123+
"artist": "Maroon 5",
124+
"duration": 189,
125+
"bpm": 91,
126+
"genre": "pop"
127+
},
128+
{
129+
"title": "Savage Love",
130+
"artist": "Jawsh 685 & Jason Derulo",
131+
"duration": 171,
132+
"bpm": 96,
133+
"genre": "pop"
134+
},
135+
{
136+
"title": "Levitating",
137+
"artist": "Dua Lipa",
138+
"duration": 203,
139+
"bpm": 103,
140+
"genre": "pop"
141+
},
142+
{
143+
"title": "One Dance",
144+
"artist": "Drake",
145+
"duration": 173,
146+
"bpm": 104,
147+
"genre": "afrobeats"
148+
},
149+
{
150+
"title": "Stressed Out",
151+
"artist": "Twenty One Pilots",
152+
"duration": 185,
153+
"bpm": 85,
154+
"genre": "alternative"
155+
},
156+
{
157+
"title": "Radioactive",
158+
"artist": "Imagine Dragons",
159+
"duration": 186,
160+
"bpm": 136,
161+
"genre": "rock"
162+
},
163+
{
164+
"title": "Rolling in the Deep",
165+
"artist": "Adele",
166+
"duration": 228,
167+
"bpm": 105,
168+
"genre": "pop"
169+
},
170+
{
171+
"title": "Closer",
172+
"artist": "The Chainsmokers",
173+
"duration": 244,
174+
"bpm": 95,
175+
"genre": "electronic"
176+
},
177+
{
178+
"title": "Shake It Off",
179+
"artist": "Taylor Swift",
180+
"duration": 219,
181+
"bpm": 160,
182+
"genre": "pop"
183+
},
184+
{
185+
"title": "Uptown Funk",
186+
"artist": "Mark Ronson ft. Bruno Mars",
187+
"duration": 269,
188+
"bpm": 115,
189+
"genre": "funk"
190+
},
191+
{
192+
"title": "Sorry",
193+
"artist": "Justin Bieber",
194+
"duration": 200,
195+
"bpm": 100,
196+
"genre": "pop"
197+
},
198+
{
199+
"title": "The Middle",
200+
"artist": "Zedd, Maren Morris",
201+
"duration": 184,
202+
"bpm": 99,
203+
"genre": "electronic"
204+
},
205+
{
206+
"title": "Shallow",
207+
"artist": "Lady Gaga & Bradley Cooper",
208+
"duration": 215,
209+
"bpm": 96,
210+
"genre": "pop"
211+
},
212+
{
213+
"title": "Despacito",
214+
"artist": "Luis Fonsi ft. Daddy Yankee",
215+
"duration": 229,
216+
"bpm": 89,
217+
"genre": "reggaeton"
218+
},
219+
{
220+
"title": "Attention",
221+
"artist": "Charlie Puth",
222+
"duration": 211,
223+
"bpm": 100,
224+
"genre": "pop"
225+
},
226+
{
227+
"title": "Stay",
228+
"artist": "The Kid LAROI & Justin Bieber",
229+
"duration": 141,
230+
"bpm": 170,
231+
"genre": "pop"
232+
},
233+
{
234+
"title": "Circles",
235+
"artist": "Post Malone",
236+
"duration": 215,
237+
"bpm": 120,
238+
"genre": "pop"
239+
},
240+
{
241+
"title": "Call Out My Name",
242+
"artist": "The Weeknd",
243+
"duration": 234,
244+
"bpm": 135,
245+
"genre": "R&B"
246+
},
247+
{
248+
"title": "Heat Waves",
249+
"artist": "Glass Animals",
250+
"duration": 239,
251+
"bpm": 81,
252+
"genre": "pop"
253+
},
254+
{
255+
"title": "Good 4 U",
256+
"artist": "Olivia Rodrigo",
257+
"duration": 178,
258+
"bpm": 170,
259+
"genre": "pop-punk"
260+
},
261+
{
262+
"title": "Montero (Call Me By Your Name)",
263+
"artist": "Lil Nas X",
264+
"duration": 137,
265+
"bpm": 89,
266+
"genre": "hip-hop"
267+
},
268+
{
269+
"title": "Industry Baby",
270+
"artist": "Lil Nas X ft. Jack Harlow",
271+
"duration": 212,
272+
"bpm": 150,
273+
"genre": "hip-hop"
274+
},
275+
{
276+
"title": "Dynamite",
277+
"artist": "BTS",
278+
"duration": 199,
279+
"bpm": 114,
280+
"genre": "pop"
281+
},
282+
{
283+
"title": "Peaches",
284+
"artist": "Justin Bieber ft. Daniel Caesar",
285+
"duration": 198,
286+
"bpm": 90,
287+
"genre": "R&B"
288+
},
289+
{
290+
"title": "Positions",
291+
"artist": "Ariana Grande",
292+
"duration": 172,
293+
"bpm": 100,
294+
"genre": "pop"
295+
},
296+
{
297+
"title": "Watermelon Sugar",
298+
"artist": "Harry Styles",
299+
"duration": 174,
300+
"bpm": 96,
301+
"genre": "pop"
302+
},
303+
{
304+
"title": "Say So",
305+
"artist": "Doja Cat",
306+
"duration": 237,
307+
"bpm": 111,
308+
"genre": "pop"
309+
},
310+
{
311+
"title": "Mood",
312+
"artist": "24kGoldn ft. Iann Dior",
313+
"duration": 140,
314+
"bpm": 91,
315+
"genre": "hip-hop"
316+
}
317+
]

0 commit comments

Comments
 (0)