Git Product home page Git Product logo

spotify-playground's Introduction

Spotify-Playground

This project is a collection of Python scripts that interact with the Spotify Web API to extract information related to user and playlist details, as well as to retrieve tracks and associated details of a users public playlists.

Prerequisites:

Before using these scripts, there are a few prerequisites that need to be set up:

1) A Spotify account

2) Spotify API client ID and secret. To obtain these, create a Spotify Developer account, create a new application, and retrieve the client ID and secret from the application dashboard.

3) The following packages need to be installed:

requests 
base64 
os 
dotenv 
re 
pandas

Example:

pip install -r requirements.txt

File structure:

This project contains the following files:

  • get_spotify_token.py: This script contains a function to retrieve an access token for the Spotify Web API, using the Spotify API client ID and secret.

  • get_user_details.py: This script contains a SpotifyUser class, which takes a Spotify user link as input and extracts the user's display name, ID, as well as the names and IDs of their playlists.

  • get_playlist_tracks.py: This script contains a function to retrieve tracks and associated details from a given playlist. The function outputs a CSV file that contains the following information: Track Id, Track Name, Artist Id, Artist Name, Album Id, Album Name, and Artist Genre.

  • .env: This file contains environment variables for the Spotify API client ID and secret.

How to use:

  • Clone the project repository and navigate to the project directory.
  • Set the Spotify API client ID and secret in the .env file.
  • In the command line, run python main.py . After running the main.py, user's profile link will be requested as an input from the terminal so please provide spotify profile link as an input for the program. This will output the user's display name, ID, as well as the names and IDs of their playlists and fetches them in a csv file generated under Playlists folder.

Note: Ensure that the necessary packages have been installed before running the scripts.

Authors:

This project was created by mervegunak and karakayautku4.

spotify-playground's People

Contributors

mervegunak avatar karakayautku4 avatar

Watchers

 avatar  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.