Skip to main content

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. 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

$ 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):

>>> from spotify_local import SpotifyLocal

>>> with SpotifyLocal() as s:
        pass

Pause the Spotify Client:

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

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

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

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

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

Register a callback and listen for events:

>>> 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

Release files for spotify-local-control 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spotify-local-control 0.2.3
File Size Uploaded
spotify-local-control-0.2.3.tar.gz 5.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for spotify-local-control 0.2.3
File Interpreter ABI Platform
spotify_local_control-0.2.3-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 12.9 kB

Release files / spotify-local-control-0.2.3.tar.gz

Download URL spotify-local-control-0.2.3.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a9ab38d92c8da8c0c1d4437ae9ffae33ee64538baa575bff04ab0de31bdf03dc
BLAKE2b-256 checksum
How to use checksums
15b8e8b27fcef47c15ed3a7102a6f321f32fe8f5cdeb83990444ca86ac13cea7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / spotify_local_control-0.2.3-py2.py3-none-any.whl

Download URL spotify_local_control-0.2.3-py2.py3-none-any.whl
Size 7.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
96d37adf728ec7568e86ba5a4b081ca127218d87b40385b02ed38d83e737783a
BLAKE2b-256 checksum
How to use checksums
d156b4fb6775103bb98ec4622a4169588bc25c078b56c221b766c29e04aa3633
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.2.3 This release

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page