Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.

Latest commit

 

History

History
82 lines (68 loc) · 4.26 KB

README.md

File metadata and controls

82 lines (68 loc) · 4.26 KB

What is this repo?

Sortify is a Python app built with the Flask framework. It uses the Spotipy API to allow you to view and sort your Spotify playlists to your heart's content. I hosted the app on Heroku.

I decided to make this app to build my web-app skills, this is my first ever web-app and I'm quite proud of it.

Features supported:

  • Supported sorting options:
    • Alphabetically (A-Z)
    • Alphabetically (Z-A)
    • Release Date (Chronological)
    • Release Date (Non Chronological)
    • Date Added
  • View playlist tracks in a table
  • Heroku deploy ready
  • Can sort unlimited number of tracks
  • Maintains the date added upon sorting (only if the playlist has under 100 tracks)

To do list:

  • Add support to sort playlists of more than 100 tracks
  • Maintain 'added_at' date after sorting
  • Add support to sort other people's playlists
  • Add option to sort playlist into new playlist

Installation

Prerequisites:

  • A server, could be your own computer or Heroku; this repository is Heroku ready
  • Python 3.8 or above
  • A Spotify app

Part 1 (Spotify API):

  • First you need to setup a Spotify API app. To do this go to the Spotify Developer's Dashboard
  • Create an app
  • Name the app anything and describe it as anything. But set it as a Website
  • On the app's page click Edit Settings and under Redirect URIs add this: http://127.0.0.1:5000/callback
  • If your app is not locally hosted than make the Redirect URI something like this https://yourwebsite.com/callback
  • Finally exit back onto the main app's page and copy down the Client ID and Client Secret, you will need these in the next step

Part 2 (The App):

  • Now it's time to make the app. First clone this repository in a command line using git clone https://github.com/eliasbenb/Sortify.git
  • CD into the directory with cd Sortify
  • Open app.py with a text editor and change the following variables:
    • app.secret_key to any string e.g. "string123"
    • SPOTIFY_CLIENT_ID to the Client ID you got from Step 1
    • SPOTIFY_CLIENT_SECRET to the Client Secret you got from Step 1
    • REDIRECT_URI to whatever you set your Redirect URI to in Step 1
  • If you are setting this up for a public website like I am I would recommend using Environment Variables to set the above variables
  • Now your app is ready to be used, to start the app just enter this in a command line flask run

Usage:

Home Page:

  • The home page contains Sortify information
  • And it contains a 'Login' button, clicking it will lead to the Spotify authentication page

Home Page

Login Page:

  • After successfully authenticating your Spotify account, you will receive a success message

Login Page

Playlists Page:

  • After scrolling down on the playlists page you will see all your playlists's images, clicking one will open that playlist's page

Playlists Page

Playlist Page:

  • The playlist page contains a table which displays all the playlist's tracks and its information
  • Below that there are a group of buttons which allow you to sort the playlist:
    • Alphabetically (A-Z)
    • Alphabetically (Z-A)
    • Release Date (Chronological)
    • Release Date (Non Chronological)
    • Added Date

Playlist Page