Coder Social home page Coder Social logo

clintmcmahon / kexpify Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 2.0 18 KB

A Python library that hits the KEXP Legacy API to create a Spotify playlist for a given period in time.

Python 100.00%
python python3 kexp api radio music spotify spotipy seattle

kexpify's Introduction

KEXPify

KEXPify is a Python library that hits the KEXP Legacy API to create a Spotify playlist for a given period in time.

Prerequisites

Python3 (Python2 will require a couple code changes)

Spotify account

Spotify API Credentials

Spotipy

pip3 install git+https://github.com/plamere/spotipy.git --upgrade

Requests

pip3 install requests

Installing

Clone this repository

git clone https://github.com/clintmcmahon/kexpify

Change directory to kexpify

cd kexpify

Create a local_config.py file and populate with your values. Your file should look like this

#encoding: utf-8

SPOTIFY_USERNAME = [your Spotify username]
SPOTIFY_CLIENT_SECRET = [your Spotify API Client Secret]
SPOTIFY_CLIENT_ID = [your Spotify API Client ID]
SPOTIFY_SCOPE = 'playlist-modify-public playlist-modify-private playlist-read-collaborative'
SPOTIFY_REDIRECT_URI = 'http://localhost'

Run the code

python3 kexp.py [playlist_name] [start_date] [end_date] [playlist_description]

A browser window will automatically open where you will authenticate with Spotify. After you've given access to your Spotify account the browser will redirect to a http://localhost url. Copy the localhost url and paste it into the command line. You'll only need to do this once, the code will create a cache authentication file on your local machine.

After you've authenticated the program will use those cached credentials to read the playlist in your Spotify account, then either create a new playlist or delete the contents of the existing playlist before adding the latest tracks from the API.

Built With

Acknowledgments

kexpify's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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