Skip to main content

Get currently playing song and artist from Spotify faster without using the API.

Project description

SwSpotify

Build Status Build status codecov PyPI Downloads

SwSpotify is a python library to get the song and artist of the currently playing song from the Spotify application faster and without using the API. It works on Windows, Linux and macOS.

The original repository was spotilib which worked just for Windows and hasn't been updated since a long while when it broke on account of Spotify updating their application.

Originally made for use in SwagLyrics for Spotify.

Installation

Requires Python3. Use pip or pip3 depending on your installation.

pip install SwSpotify

Usage

Use it in your project by importing it as:

from SwSpotify import spotify

Then you can access the song and artist as:

>>> spotify.song()
'Hello'
>>> spotify.artist()
'Adele'

Since mostly song and artist are used in conjunction, there is a current() method as well.

>>> spotify.current()
('Hello', 'Adele')

This allows you to access song and artist by tuple unpacking as:

>>> song, artist = spotify.current()

If Spotify is not running or is paused, a SpotifyNotRunning Exception is raised.

Compiling SwSpotify for Development

  • Clone the repo by git clone https://github.com/SwagLyrics/SwSpotify.git or use ssh.
  • cd into the cloned repo.
  • pip install -e . the -e flag installs it locally in editable mode.

Contributing

Sure, improvements/fixes/issues everything is welcome :)

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

SwSpotify-1.0.0.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

SwSpotify-1.0.0-py3-none-any.whl (4.4 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