Metadata-Version: 2.1
Name: spotify-local-control
Version: 0.2.2
Summary: Communicate with the Spotify's web helper process to control some basic aspects of spotify
Home-page: https://github.com/erinxocon/spotify-local-control
Author: Erin O'Connell
Author-email: erinocon5@gmail.com
License: MIT
Platform: UNKNOWN
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.6.0
Requires-Dist: requests
Requires-Dist: keyboard
Requires-Dist: pyobjc-framework-Quartz; sys_platform == "darwin"


Spotify-Local-Control: A multi-platform API to control the local Spotify Client
===============================================================================

**Spotify-Local-Control** library is designed to make controlling the Spotify client on your local machine possible!
This is a wrapper for the web helper process which exposes a simple api.
**Spotify-Local-Control** is inspired by `SpotifyAPI-NET <https://github.com/JohnnyCrazy/SpotifyAPI-NET>`_.
This library allows you to perform simple actions quickly, or listen to events and register callbacks when
a song changes, or the pause button is pushed.

When using this library you automatically get:

- The ability to play/pause the current song
- The ability to change tracks
- You can register callbacks and listen for events when the state of Spotify changes
- A nice context manager api using `with`


Installation
============

.. code-block:: shell

    $ pipenv install spotify-local-control

Only **Python 3.6** is supported.


Tutorial & Usage
================

Connect to the Spotify Client (Spotify must be open to do this):

.. code-block:: pycon

    >>> from spotify_local import SpotifyLocal

    >>> with SpotifyLocal() as s:
            pass

Pause the Spotify Client:

.. code-block:: pycon

    >>> with SpotifyLocal() as s:
            s.pause()


Grab the current state of the Spotify client, including now playing information:

.. code-block:: pycon

    >>> with SpotifyLocal() as s:
            print(s.get_current_status())

Play a playlist, song, album, artist, etc using a Spotify uri link:

.. code-block:: pycon

    >>> with SpotifyLocal() as s:
            s.playURI('spotify:track:0thLhIqWsqqycEqFONOyhu')

Register a callback and listen for events:

.. code-block:: pycon

    >>> from spotify_local import SpotifyLocal
    >>> def test(new_status):
    ...     print(new_status)
    >>> s = SpotifyLocal()
    >>> s.connect()
    >>> s.on_status_change += test
    >>> s.listen_for_events()
    >>> print("Do more stuff because that runs in the background")


License
=======
MIT

