My favorites | Sign in
Project Home Wiki Issues Source
Project Information
Members
Featured
Downloads

IMPORTANT

This project is not maintained anymore. If it still works, it is only because of sheer luck. Feel free to contact me if you would like to contribute to pytifys continued existence by becoming a committer.

Features

  • Allows for control of the Spotify media player in Python scripts
  • A simple command line syntax for controlling the Spotify media player from console

Installing

  1. Make sure you have Python installed with the Python for Windows extensions. It can be found and downloaded from here: http://sourceforge.net/projects/pywin32/
  2. Unzip the latest pytify zip file that can be downloaded from the featured downloads section on this page
  3. Open the console in the directory the files were unzipped to
  4. Type python setup.py install

Hopefully, you can now run pytify.py from the command line anywhere in your system.

How to use

From a Python script

from pytify import Spotify
spotify = Spotify()

spotify.FUNCTION

where FUNCTION is one of:

getCurrentTrack() Returns title of the current playing track
getCurrentArtist()Returns artist name for the current playing track
isPlayingreturns True if spotify is currently playing, otherwise False
playpause()Play or pause Spotify
stop()Stops playback in Spotify
focus()Giving the Spotify window focus
next()Play next track in queue
previous()Play previous track in queue
volumeUp()Turns volume up
volumeDown()Turns volume down
mute()Mutes Spotify

From command line

python pytify ARGUMENT

Where ARGUMENT is one of:

statusPrints the Spotify status
playpausePlay or pause Spotify
stopStop playback
nextPlay next track in queue
previousPlay previous track in queue
volupTurns volume up
voldownTurns volume down
muteMutes Spotify
isplayingPrints True if spotify is currently playing, otherwise False
currenttrackPrints title of the current track
currentartistPrints artist name for the current track
focusGiving the Spotify window focus

This project is completely unofficial and by no means affiliated with spotify.com

Thanks to zowat@Toastify for publishing the action IDs used when sending messages to the Spotify Window

Powered by Google Project Hosting