ChartSync is a full-stack web application that lets users transform any Billboard chart into a fully generated Spotify playlist β customized, editable, and built using real historical chart data.
The user selects a chart, date range, number of songs, and ChartSync automatically builds a playlist, lets the user edit it inline, and then adds it directly to their Spotify account using OAuth authentication.
- Pulls tracks from multiple Billboard charts (
Hot 100,Billboard 200,Radio, etc.) - Dynamically restricts date ranges based on each chartβs actual data
- CSV parsing with Pandas to extract song data
- Generates a playlist from chart rankings for a chosen date range
- Duplicate handling + βomit songβ support
- Per-track album art, title, and artist info
- Tracks missing album art use a fallback default image
- Delete songs by clicking checkbox
- Regenerate playlist without removed songs
- No page refresh β everything async via
fetch()+ JSON
- OAuth login with Spotipy & Spotify API
- Tokens securely stored in session
- Automatic token refresh
- Create playlist on the userβs Spotify account
- Batch add tracks for large playlists
- Returns songs that failed to match Spotifyβs catalog
- JS fetch calls β Flask backend β JSON responses
- Loading states, error handling, and dynamic UI updates
- Responsive βresults windowβ that scrolls independently
- Reset, regenerate, and add-to-Spotify actions
- Modern Spotify-inspired design
- Centered header layout with right-aligned login/profile
- Responsive layout
- (CSS delivered separately)
- HTML5, CSS3
- Vanilla JavaScript (async + fetch API)
- Dynamic DOM updates and event-driven UI
- Python 3
- Flask (routes, sessions, JSON API endpoints)
- Spotipy (Spotify API client)
- Pandas (CSV/chart parsing)
- Virtual environment (
venv) - Gunicorn (production server)
- Procfile for deployment
- Environment variables via
.env
JS updates date min/max dynamically based on chart metadata derived from CSV.
Payload sent as JSON:
{
"chart": "Hot 100",
"start": "2024-01-01",
"end": "2024-02-01",
"name": "My Playlist",
"amount": 50,
"omit": [],
"songs": []
}- Reads chart CSV
- Filters by date
- Picks top N songs
- Removes omitted songs
- Returns a structured JSON list of tracks
- Checkboxes auto-select the entire row
- Deleted songs get pushed into the
omitlist
- OAuth login required
- Application creates playlist under the userβs Spotify account
- Adds track URIs in batches
- Returns any tracks not found by Spotify
git clone https://github.com/Patdabaker/chartsync.git
cd chartsyncpython -m venv venv
source venv/bin/activate # Mac/Linux
venv\Scripts\activate # Windowspip install -r requirements.txtCreate .env:
FLASK_SECRET_KEY=your-secret
SPOTIFY_CLIENT_ID=your-client-id
SPOTIFY_CLIENT_SECRET=your-client-secret
SPOTIFY_REDIRECT_URI=http://127.0.0.1:5000/callback
SPOTIFY_SCOPE='playlist-modify-private playlist-modify-public'
flask runChartSync supports deployment via:
Your Procfile typically contains:
web: gunicorn app:app
chartsync/
β
βββ app.py # Flask backend
βββ generate.py # Chart parsing + playlist logic
βββ static/
β βββ images/
β β βββ default_art.png
β βββ css/
β β βββ styles.css
β βββ main.js
βββ templates/
β βββ base.html
β βββ index.html
βββ requirements.txt
βββ Procfile
βββ README.md
These are optional upgrade ideas:
- OAuth auto-refresh UI
- Multi-chart mixed playlists
- Genre filtering
- βInclude featured artistsβ toggle
- Shareable playlist preview page
- Light/Dark theme toggle
- More Spotify-like UI components
- Mobile responsive optimization
- Background task queue for long operations
- Cloud caching (Redis)
MIT License β feel free to fork, remix, and build upon!
- Billboard for chart data
- Spotify API + Spotipy
- CS50x (project inspiration)
- Album art sources from dataset