8000 GitHub - Gomezrbz/Spotify-Genre-Analysis: This project retrieves all the genres from the user's saved tracks on Spotify and maps them to general genres. It also provides a count of the number of tracks in each general genre.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

This project retrieves all the genres from the user's saved tracks on Spotify and maps them to general genres. It also provides a count of the number of tracks in each general genre.

Notifications You must be signed in to change notification settings

Gomezrbz/Spotify-Genre-Analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spotify Genre Analysis

This project is designed to retrieve all genres from a user's saved tracks on Spotify and map them to broader, general genres. It then counts the number of tracks in each general genre and displays the results.

What the Code Does

  1. Retrieves Saved Tracks: The code connects to the Spotify API and fetches the user's saved tracks in batches of 50.

  2. Maps Specific Genres to General Genres: Using a predefined mapping, the code categorizes specific Spotify genres into broader general genres (e.g., "dance pop" becomes "Pop").

  3. Counts Tracks by Genre: The code counts the number of tracks in each general genre and outputs these counts.

  4. Environment Setup: The script requires Spotify API credentials to authenticate and fetch data from the user's library.

Prerequisites

  • Python: Make sure Python is installed on your system. You can download it from Python's official website.

  • bashCopiar códigopip install spotipy

  • Spotify Developer Account: You need a Spotify Developer account to obtain API credentials. Sign up at Spotify Developer.

Things Needed to Run the Code

  1. You can get these by creating an application in the Spotify Developer Dashboard.

    • Client ID

    • Client Secret

    • Redirect URI

  2. Environment Variables: The script requires environment variables to securely store your Spotify API credentials.

Environment Variables

Set up the following environment variables on your system:

  • SPOTIFY_CLIENT_ID: Your Spotify API client ID.

  • SPOTIFY_CLIENT_SECRET: Your Spotify API client secret.

  • SPOTIFY_REDIRECT_URI: Your Spotify API redirect URI.

Links Used

  • Spotipy Documentation: Documentation for the Spotipy library used to interact with the Spotify API.

  • Spotify Developer API: Official documentation for the Spotify Web API, used for fetching user data and managing playlists.

About

This project retrieves all the genres from the user's saved tracks on Spotify and maps them to general genres. It also provides a count of the number of tracks in each general genre.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0