Skip to main content

A simple spotify tool for the terminal

Project description

Spotr - A spotify tool for the terminal

A very simple CLI for controlling your spotify on the fly in the terminal. Made in python for simplicity

Installation

$ pip install spotrpy

Or clone the repo and install locally

$ pip install -e .
  1. Register an app in spotify for developers "https://developer.spotify.com/dashboard/applications"

  2. Run any spotr command

    • If command is not recognized, you might have to add wherever python stores packages to path, this can be different depending on OS.
      • Linux - on linux add "~/.local/bin" to your $PATH, this can be done by adding the following line to your .rc file (export PATH="$HOME/.local/bin:$PATH")
      • MacOs - on mac i personally fixed it by adding this to my .zshrc file (export PATH="$HOME/Library/Python/3.11/bin:$PATH") Here you have to change the python verion number accordingly
  3. You will be prompted to create config.json and paste in client and secret id from spotify app

  4. After these steps everything should work and you can enjoy spotr

Built-in Commands

ascii - Ascii image for current track
authorise - Authenticate with Spotify API
config - Modify config values in the terminal
current - Display information about the current track
next - Play next track
playback - Set playback state
playlist - Choose a playlist
playlistadd - Add currently playing track to playlist
previous - Play previous track
qsearch - Quicksearch for tracks
queue - Get Queue
recent - Get recently played tracks
recommend - Play random / recommended tracks based on recent tracks
refresh - Refresh API key
replay - Replay/Restart currently playing song
search - Search for anything on spotify, Types - track, playlist, album
seek - Seek posistion for track in seconds
shuffle - Toggle shuffle, on / off
start - Start/Resume playing
stop - Stop/Pause playing
vol - Ajust volume
volume - Ajust volume
web - Open currently playing track in a broswer

Modifications

You can easily create your own commands by adding a file in spotrpy/commands using the example.py template. As soon as the file is created and saved you can run it on the terminal with (spotr command)

I recommend going to spotifys API documentation to get a grasp of what is possible

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spotrpy-2.1.tar.gz (15.2 kB view hashes)

Uploaded Source

Built Distribution

spotrpy-2.1-py3-none-any.whl (33.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page