Luismodesto86/Songs_Time_Capsule
๐ต Sound of the Years
A personal music timeline built with Streamlit โ scroll through the years, unlock songs one by one, and play their videos directly in the app.
What it does
Sound of the Years is an interactive vertical calendar of music memories. Each year from 2004 to 2025 lives in its own capsule. Open a year, and you'll find 5 hidden songs โ titles are blurred until you choose to play one. Hit play and the video loads right there in the page.
Key features:
- Vertical timeline โ one capsule per year, scroll top to bottom through time
- Era-aware visuals โ each era has its own color accent and background tone that shifts as you scroll
- Hidden songs โ titles are blurred until you press Play, keeping the discovery feeling alive
- Inline video player โ YouTube video embeds directly in the app with autoplay
- Your songs โ the playlist is driven entirely by a CSV file you control
File structure
music_timeline/
โโโ app.py # Main Streamlit app
โโโ songs.csv # Your original song data
โโโ songs_with_ids.csv # The working file: songs + YouTube IDs
โโโ youtube_id_helper.py # Helper to generate the lookup template
โโโ build_app.py # Rebuilds app.py from songs_with_ids.csv
โโโ requirements.txt # Python dependencies
โโโ README.md # This fileHow to run
1. Install dependencies
pip install -r requirements.txt2. Run the app
streamlit run app.pyThe app opens at http://localhost:8501 in your browser.
How to use the app
- Scroll down the timeline to browse years
- Click "โผ [year]" to open a year capsule and see 5 song slots
- Click "โถ Play #1" on any slot โ the title reveals and the video starts playing
- Click "โธ Stop" to stop playback
- Click "โฒ Close" to collapse the year back
Only one year can be open at a time. Opening a new year closes the previous one.
How to update the songs
Step 1 โ Edit songs_with_ids.csv
This is the master data file. It has one row per song with these columns:
Step 2 โ Get the YouTube ID
For each song, open its YouTube video. The ID is the 11-character code in the URL:
https://www.youtube.com/watch?v=Ju8Hr50Ckwk&list=...
^^^^^^^^^^^
ID = Ju8Hr50CkwkCopy everything between v= and the first & (or end of URL). Paste it into the youtube_id column.
You can also use the helper script to auto-generate search links for all songs:
python3 youtube_id_helper.pyThis prints each song with a ready-to-click YouTube search URL.
Step 3 โ Rebuild the app
Once all youtube_id values are filled in:
python3 build_app.pyThis validates the CSV (warns you about any missing IDs) and regenerates app.py with your updated songs.
How to customize
Change the songs for a year
Open songs_with_ids.csv and edit any row. You can change the title, artist, and youtubeid freely. Run `buildapp.py` afterwards.
Add or remove a year
- Add a year: add 5 rows with the new year value in
songs_with_ids.csv, then runbuild_app.py. - Remove a year: delete its 5 rows from
songs_with_ids.csv, then runbuild_app.py.
Then also update the ERA_THEMES dictionary in app.py (or build_app.py) to add/remove the matching theme entry.
Change the era colors and labels
In app.py, find the ERA_THEMES dictionary near the top. Each year has:
2004: {
"bg": "#0a0a1a", # Page background tint for this year
"accent": "#ff6b35", # Main color: year number, song title, player bar
"glow": "#ff4500", # Glow/shadow color (usually a darker shade of accent)
"era": "Early 2000s", # Small label shown above the vibe text
"vibe": "Pop & R&B boom" # Subtitle line inside the capsule
},Change any of these values to retheme a year.
Change the number of songs per year
The app supports any number of songs per year โ not just 5. Add or remove rows in songs_with_ids.csv for that year, then run build_app.py.
Change fonts or layout
All visual styles live in the CSS string near the top of app.py. The app uses three Google Fonts:
- Bebas Neue โ year numbers and song titles when playing
- Space Mono โ small labels, era tags, artist names
- Rajdhani โ body text and vibe descriptions
To swap a font, change the @import URL at the top of the CSS block and update the font-family references.
Deploying to Streamlit Cloud
- Push your project folder to a GitHub repository
- Go to share.streamlit.io and connect your repo
- Set the main file path to
app.py - Deploy โ Streamlit Cloud installs
requirements.txtautomatically
Make suresongs_with_ids.csvis committed to the repo (it's needed bybuild_app.pybut not by the running app โapp.pyis self-contained).
Requirements
streamlit>=1.32.0Python 3.9 or higher recommended.
