Metadata-Version: 2.1
Name: SwSpotify
Version: 1.0.0
Summary: Get currently playing song and artist from Spotify faster without using the API.
Home-page: https://github.com/SwagLyrics/SwSpotify
Author: Aadi Bajpai
Author-email: swspotify@swaglyrics.dev
License: UNKNOWN
Keywords: spotify swaglyrics python app
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
Requires-Dist: pyobjc ; platform_system == "Darwin"
Requires-Dist: pywin32 ; platform_system == "Windows"

# SwSpotify

[![Build Status](https://travis-ci.com/SwagLyrics/SwSpotify.svg?branch=master)](https://travis-ci.com/SwagLyrics/SwSpotify)
[![Build status](https://ci.appveyor.com/api/projects/status/c8heviwe9q2m8lb0?svg=true)](https://ci.appveyor.com/project/TheClashster/swspotify)
[![codecov](https://codecov.io/gh/SwagLyrics/SwSpotify/branch/master/graph/badge.svg)](https://codecov.io/gh/SwagLyrics/SwSpotify)
![PyPI](https://img.shields.io/pypi/v/swspotify.svg)
[![Downloads](https://pepy.tech/badge/swspotify)](https://pepy.tech/project/swspotify)

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](https://github.com/XanderMJ/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](https://github.com/SwagLyrics/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:
```pydocstring
from SwSpotify import spotify
```
Then you can access the song and artist as:
```pydocstring
>>> spotify.song()
'Hello'
>>> spotify.artist()
'Adele'
```
Since mostly song and artist are used in conjunction, there is a `current()` method as well.
```pydocstring
>>> spotify.current()
('Hello', 'Adele')
```
This allows you to access song and artist by tuple unpacking as:
```pydocstring
>>> 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 :)


