Skip to content

Exploratory analysis of the top 50 tracks on Spotify Brazil

Notifications You must be signed in to change notification settings

brunnox/spotify_top50_study

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues LinkedIn

Project Banner

🎧 Project Overview

This repository performs an exploratory data analysis on Spotify Brazil’s Top 50 tracks using Python and Jupyter Notebook. By leveraging the Spotify Web API, it extracts track and artist metadata to uncover insights into musical trends in Brazil.


📋 Prerequisites

  • Python 3.7+
  • pip
  • Existing `.env` file in the project root containing your Spotify API credentials.

🔑 Spotify API Credentials

You already have a .env file—simply replace the placeholders with your actual keys:

client_id="YOUR_CLIENT_ID_HERE"
client_secret="YOUR_CLIENT_SECRET_HERE"

Note: Do not include extra quotes or whitespace.

To obtain these values:

  1. Go to the Spotify Developer Dashboard and log in.
  2. Click Create an App.
  3. Copy the Client ID and click Show Client Secret.

🚀 Installation

  1. Clone the repository:
    git clone https://github.com/brunnox/spotify_top50_study.git
  2. Navigate to the project folder:
    cd spotify_top50_study
  3. Install dependencies:
    pip install -r requirements.txt

📂 Directory Structure

spotify_top50_study/
├── imgs/              # Images used in README and notebook
│   └── banner.png
├── .env               # Your Spotify client_id and client_secret
├── spotify.ipynb      # Jupyter Notebook with full analysis
└── requirements.txt   # File with necessary python libs to install

📝 Notebook Description (spotify.ipynb)

  1. Banner Display: shows imgs/banner.png.
  2. Environment Setup: loads .env via python-dotenv.
  3. Authentication: implements the Client Credentials flow to fetch an access token.
  4. Data Collection: requests the “Top 50 Brazil” playlist endpoint.
  5. Data Transformation: builds a pandas.DataFrame with attributes like name, popularity, duration, and explicit flag.
  6. Exploratory Analysis: computes descriptive stats and visualizes with Plotly Express.
  7. Regression Modeling: fits a LinearRegression model to explore feature correlations.

▶️ Running the Analysis

jupyter notebook spotify.ipynb

Run cells in order to reproduce the full workflow.


✉️ Author

Developed by brunnoxGitHub/brunnox

About

Exploratory analysis of the top 50 tracks on Spotify Brazil

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published