Skip to content

The songs you didn’t know you were looking for. Built for NwHacks 2022

Notifications You must be signed in to change notification settings

Akash2002/spotifai-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spotif.ai

Type in any text, and spotif.ai analyzes your phrase and creates a Spotify playlist for you based on your phrase.

Built for nwHacks 2022 - Honorary Mention (6th place)!!

This is the repo for the backend code of spotif.ai. View the frontend code here!

Technologies

  • Django/Django REST Framework
  • Tensorflow
  • FastAPI
  • Jupyter Notebook and Google Colab
  • Spotify Web API

Setup

Clone this repository.

In the root of this repository, create a virtual Python environment with python3 -m venv venv.

Activate your virtual environment by running source venv/bin/activate.

If you're on windows you'll have to run source venv/Scripts/activate.

Run pip install -r requirements.txt

Create a .env file. See .env_template for details on which environment variables you need.

Note: Since loading Tensorflow models is GPU-intensive, we set up an ngrok server in a Google Colab using FastAPI. See the colab folder. The URL generated by running this file is what is used for the environment variable COLAB_SERVER_URL.

Run python manage.py migrate.

Development

Activate the server with python manage.py runserver.

Usage

spotif.ai provides the following endpoints

POST /create

{
    "headers": {
        "Content-Type": "application/json",
        "Accept": "application/json"
    },
    "body": {
        "token": "auth-token",
        "phrase": "prompt",
        "limit": 50
    }
}

POST /playlist

{
    "headers": {
        "Content-Type": "application/json",
        "Accept": "application/json"
    },
    "body": {
        "token": "auth-token",
        "playlist_name": "name",
        "playlist_description": "Auto-generated by Spotif.ai",
        "songs": "comma-separated list of song uris",
    }
}

Contributors

Akash

Evan

Kate

Prayus

About

The songs you didn’t know you were looking for. Built for NwHacks 2022

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 86.9%
  • Jupyter Notebook 13.1%