Skip to main content

End-to-end Spotify data analytics pipeline (ETL + analysis)

Project description

🎵 Spotify Data Analytics

Python Spotify API Power BI ETL Pipeline Status GitHub repo size License

End-to-end Spotify Data Analytics project using Python, Spotify Web API, and Power BI. Includes ETL pipeline, data cleaning, feature engineering, and insights on music trends & audio features. #data-engineering #data-analytics #spotify #python #ETL

📊 Sample Visuals

Here are some sample analytics from the project:

Distribution of Track Popularity

Distribution of Track Popularity

Top Genres by Average Popularity

Top 10 Genres by Average Popularity

✨ What you get

  • Python ETL using Spotipy (Spotify Web API)
  • Cleaned analytics-ready datasets (CSV/Parquet)
  • Feature engineering & correlations to explain what makes a hit
  • Ready-made notebook for quick exploration
  • Dashboard spec and sample visuals to replicate in Power BI

🧱 Project structure

spotify-data-analytics/
├─ README.md
├─ requirements.txt
├─ LICENSE
├─ .gitignore
├─ .env.example
├─ src/
│  ├─ extract_data.py
│  ├─ transform_data.py
│  ├─ load_data.py
│  └─ utils.py
├─ notebooks/
│  └─ spotify_exploration.ipynb
├─ data/
│  ├─ raw/
│  └─ processed/
├─ reports/
│  └─ dashboard_spec.md
└─ .github/workflows/
   └─ ci.yml

💼 Business Use Cases

  • Music Industry Insights: Identify audio features (tempo, energy, danceability) contributing to hit songs.
  • Artist Growth Tracking: Analyze listener trends and popularity across regions.
  • Playlist Optimization: Curate playlists based on user listening patterns and genre preferences.
  • Market Research: Help record labels evaluate trends to guide promotions and album releases.
  • Recommendation Systems: Build smarter music recommendations using data analytics insights.

🚀 Setup

  1. Create a Spotify app
  1. Clone & install
git clone https://github.com/LingeswaranR-22/spotify-data-analytics.git
cd spotify-data-analytics
python -m venv .venv && source .venv/bin/activate  # Windows: .venv\Scripts\activate
pip install -r requirements.txt
  1. Set environment
cp .env.example .env
# Fill SPOTIFY_CLIENT_ID, SPOTIFY_CLIENT_SECRET

▶️ Run the pipeline

Extract (API → CSV):

python src/extract_data.py --markets IN US GB --playlists "Top 50 - Global" "Viral 50 - Global"

Transform (clean, join, features):

python src/transform_data.py

Load (optional—parquet, sample Snowflake stub):

python src/load_data.py --to parquet

Data will appear under data/raw and data/processed.

🔎 What it pulls

  • Tracks from curated playlists (e.g., Top 50 - Global, Viral 50 - Global).
  • Track audio features (danceability, energy, valence, tempo, acousticness, etc.).
  • Artist details (name, popularity, genres).

📈 Example questions answered

  • Which audio features correlate with popularity?
  • What genres dominate top charts?
  • Which artists are breaking out across markets?
  • What tempo/energy ranges are most common among hits?

🗺️ Dashboard (Power BI / Looker)

Create visuals on data/processed/ outputs:

  • Genre Popularity (bar/treemap)
  • Audio Features vs Popularity (scatter)
  • Artist Popularity vs Followers (bubble)
  • Tempo distributions (histogram)

A dashboard plan is in reports/dashboard_spec.md.

🧪 CI (lightweight)

A tiny GitHub Action runs flake checks & unit smoke tests on push.

📝 Notes on auth

  • Most public playlist/track data works with Client Credentials (no user login).
  • If you need user playlists, flip the --user-auth flag and complete the browser login once.

Author: Lingeswaran R
License: MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spotify_data_analytics-0.1.0.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spotify_data_analytics-0.1.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file spotify_data_analytics-0.1.0.tar.gz.

File metadata

  • Download URL: spotify_data_analytics-0.1.0.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for spotify_data_analytics-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b11dce14032f1666e8e438f25fecd961f972f30fc353ea9779c3b2a4173f1d67
MD5 baf6b210a401759a61376b442734eb29
BLAKE2b-256 e0ede3cd3c760cd2b541a275c55d1aad9a3d20191e991e7753d5ce92721f5ee4

See more details on using hashes here.

File details

Details for the file spotify_data_analytics-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for spotify_data_analytics-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 25ee44bc2be69aff46d3c3780674fba2e8a5273807d22a7cdc90690ae25379aa
MD5 c893a5979e4498c5cc818270ba7f08fb
BLAKE2b-256 f97cd3f2d7f24e71a584bb0bf8c44401466b9013a9a3b73489f1da8f00d33a6b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page