Git Product home page Git Product logo

shegszz / spotify-playlist-generator Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 1.44 MB

This project demonstrates API integration and data handling using Python to create a personalized Spotify playlist based on song popularity. The script fetches top songs from the Spotify API, sorts them by popularity, and adds the top 100 songs to a new playlist.

Home Page: https://github.com/Shegszz/Spotify-Playlist-Generator

HTML 0.01% Jupyter Notebook 99.99%
api-integration data-analysis data-handling project-management python spotify-api

spotify-playlist-generator's Introduction

Spotify-Playlist-Generator(Popular Tracks Analyzer)

This project leverages the Spotify API to analyze listening habits and curate a personalized playlist of top 100 most popular liked songs.

Table of Contents

Introduction

Welcome to the Spotify Playlist Generator(Popular Tracks Analyzer) project! This project showcases my skills in data analysis, API integration, and music curation.

Project Overview

This open-source project is aimed at analyzing and curating playlists based on the popularity of tracks from a user's Spotify account. Leveraging the Spotify API and Python programming language, this project offers valuable insights into music preferences and trends. Additionally, as part of future development plans, I aim to incorporate the MusicMatch API to analyze the genres of the liked songs fetched from Spotify. While the Spotify API provides robust music data, to the best of my knowledge, it lacks a direct genre API endpoint. Therefore I plan to integrate the MusicMatch API for more comprehensive genre analysis and playlist curation, enhancing the accuracy and relevance of curated playlists not only on popularity but also on the genres that resonate with the user's preferences. Stay tuned for updates on this exciting enhancement to the project!

Key Features

  • Data Collection: Fetches your liked songs from Spotify using the Spotify API
  • Data Analysis: Leverages pandas libraries for data manipulation and exploration to uncover insights into your listening habits.
  • Playlist Creation: Generates a playlist of your top 100 liked songs with sorting options based on popularity.

Project Structure

  • README.md: Detailed project overview, usage instructions, and technology used.
  • main.py: The Python script orchestrating the project, handling everything from API credentials setup to token exchange using PKCE for fetching liked songs, extracting data, and creating the playlist.
  • index.html: Landing page for user interaction
  • Playlist image: Image

Technologies Used

  • Python for scripting and API interactions.
  • Requests library for HTTP requests.
  • Pandas library for data manipulation.
  • Spotipy library for music data access(Spotify API).

Getting Started

  • Access your Spotify for Developers dashboard using your Spotify account
  • Create an App: Provides you with the client ID and client secret needed to request an access token by implementing any of the authorization flows. The OAuth2 standard for Spotify defines four grant types or flows to request and get the access token that we need to get our Spotify data. You can follow the Authorization tutorial on the Spotify for Developers page to learn more about the OAuth flows. This project uses the authorization code with PKCE(proof key ), as it provides protection against attacks where the authorization code may be intercepted since it does not require our secret key. You can read more on the full guide for the implementation of the PKCE extension under the Authorization code with PKCE Flow.
  • Develop an HTML file to serve as landing page using GitHub pages to facilitate user interaction. To create an HTML file, follow these steps:
    • a. Navigate to the Cloned Repository Directory: Open your terminal (Command Prompt, Terminal, or equivalent). Use the cd command to navigate to the directory where your cloned repository is located. (For example:cd ~/Documents/repository-name). Replace Documents with the name of the directory where your cloned repository is located, and repository-name with the actual name of your cloned repository directory.
    • b. Create the HTML File: Once you're in the correct directory, use a text editor or code editor in the terminal to create the index.html file. For example, you can use the nano text editor: (nano index.html) This command will open a new file named index.html in the nano editor within the terminal.
    • c. Add HTML Content: In the nano editor (or any other editor you make use of), add your HTML content for the landing page. You can use the HTML code provided in this repository or create your own content.
  • Move the HTML file to your GitHub repository. Then configure your GitHub pages to access your GitHub pages url where your landing page is hosted. You can follow the Getting started tutorial on GitHub pages.
  • Make a request authorization from user's Spotify account to retrieve the authorization code, this redirects the user to Spotify for authorization by visiting the URL provided. After authorization, Spotify will redirect back to the redirect URI with the authorization code. Then use the access token to fetch data from the Spotify Web API.
  • Run the Python script to authenticate with Spotify, fetch liked tracks, and create the playlist.

How to Use

  • 1. Clone the repository.
  • 2. Set up your Spotify API credentials and redirect URI.
  • 3. Run the script to authorize and fetch liked songs.
  • 4. Analyze data and create your curated playlist.

Future Improvements

  • Expand analysis to include genre insights by leveraging the musicmatch API to analyze the genres of the liked songs fetched from Spotify.
  • Enhance visualization with interactive charts.
  • Implement machine learning for personalized recommendations.

Contributing

Feel free to contribute to this project by forking the repository, making changes, and creating pull requests.

Contact Information

For further inquiries or collaboration oppprtunities, feel free to reach out via upwork or email.

spotify-playlist-generator's People

Contributors

shegszz avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.