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.
- Python 3.7+
- pip
- Existing `.env` file in the project root containing your 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:
- Go to the Spotify Developer Dashboard and log in.
- Click Create an App.
- Copy the Client ID and click Show Client Secret.
- Clone the repository:
git clone https://github.com/brunnox/spotify_top50_study.git
- Navigate to the project folder:
cd spotify_top50_study - Install dependencies:
pip install -r requirements.txt
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
- Banner Display: shows
imgs/banner.png. - Environment Setup: loads
.envviapython-dotenv. - Authentication: implements the Client Credentials flow to fetch an access token.
- Data Collection: requests the “Top 50 Brazil” playlist endpoint.
- Data Transformation: builds a
pandas.DataFramewith attributes like name, popularity, duration, and explicit flag. - Exploratory Analysis: computes descriptive stats and visualizes with Plotly Express.
- Regression Modeling: fits a
LinearRegressionmodel to explore feature correlations.
jupyter notebook spotify.ipynbRun cells in order to reproduce the full workflow.
Developed by brunnox – GitHub/brunnox
