Giter Club home page Giter Club logo

pyspotify-connect's Introduction

pyspotify-connect

pyspotify-connect provides a Python interface to Spotify Connect's online music streaming service.

With pyspotify-connect you can create a Spotify Connect player on your device. All from your own Python applications.

pyspotify-connect uses CFFI to make a pure Python wrapper around the libspotify_embedded_shared library. It has been tested on on CPython 2.7 and 3.4, as well as PyPy 2.6. The library is only available for arm linux architectures: armv6 armel and armv7 armhf.

This wrapper is heavily based on the pyspotify wrapper for libspotify and the spotify-connect implementation Spotify Connect Web.

Dependencies

  • A Spotify Premium subscription. pyspotify-connect will not work with Spotify Free, just Spotify Premium.

  • libspotify_embeded_shared, see below for instructions.

  • Developmente packages for python and libffi. For example, for python 2.7 on Debian/Raspbian:

    apt-get install python-dev libffi-dev

Spotify Connect Library

As Spotify Connect library is not available directly from spotify you should grab it from one of the links below depending you Linux version.

Copy the appropiated library for your architecture to /usr/lib.

Installation

Install the dependencies listed above yourself, and then install the package from PyPI:

pip install pyspotify-connect

Project resources

https://img.shields.io/pypi/v/pyspotify-connect.svg?style=flat https://img.shields.io/pypi/status/pyspotify-connect.svg?style=flat https://img.shields.io/pypi/dm/pyspotify-connect.svg?style=flat https://img.shields.io/coveralls/chukysoria/pyspotify-connect.svg?maxAge=2592000

pyspotify-connect's People

Contributors

chukysoria avatar

Stargazers

Jerguš Lejko avatar  avatar ggow avatar Livio Bieri avatar Melanie Fernández avatar Erik Love avatar felix schwenzel avatar Vinícius Krolow avatar Stubertus avatar Chris avatar Dirk E. Wagner avatar Matt Feifarek avatar Stein Magnus Jodal avatar

Watchers

James Cloos avatar  avatar  avatar  avatar

pyspotify-connect's Issues

Can't install with pip

pip install pyspotify is throwing this error:

Downloading/unpacking pyspotify
  Downloading pyspotify-2.0.5.tar.gz (152kB): 152kB downloaded
  Running setup.py (path:/tmp/pip-build-F7nADM/pyspotify/setup.py) egg_info for package pyspotify

    no previously-included directories found matching 'docs/_build'
    no previously-included directories found matching 'examples/tmp'
    warning: no previously-included files matching '__pycache__/*' found anywhere in distribution
Downloading/unpacking cffi>=1.0.0 (from pyspotify)
  Downloading cffi-1.5.2.tar.gz (388kB): 388kB downloaded
  Running setup.py (path:/tmp/pip-build-F7nADM/cffi/setup.py) egg_info for package cffi

Downloading/unpacking pycparser (from cffi>=1.0.0->pyspotify)
  Downloading pycparser-2.14.tar.gz (223kB): 223kB downloaded
  Running setup.py (path:/tmp/pip-build-F7nADM/pycparser/setup.py) egg_info for package pycparser

    warning: no previously-included files matching 'yacctab.*' found under directory 'tests'
    warning: no previously-included files matching 'lextab.*' found under directory 'tests'
    warning: no previously-included files matching 'yacctab.*' found under directory 'examples'
    warning: no previously-included files matching 'lextab.*' found under directory 'examples'
Installing collected packages: pyspotify, cffi, pycparser
  Running setup.py install for pyspotify

    no previously-included directories found matching 'docs/_build'
    no previously-included directories found matching 'examples/tmp'
    warning: no previously-included files matching '__pycache__/*' found anywhere in distribution
    generating cffi module 'build/temp.linux-x86_64-2.7/spotify._spotify.c'
    building 'spotify._spotify' extension
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c build/temp.linux-x86_64-2.7/spotify._spotify.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/spotify._spotify.o
    build/temp.linux-x86_64-2.7/spotify._spotify.c: In function ‘_cffi_checkfld__sp_playlist_callbacks’:
    build/temp.linux-x86_64-2.7/spotify._spotify.c:12823:67: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
       { void(* *tmp)(sp_playlist *, sp_track * *, int, int, void *) = &p->tracks_added; (void)tmp; }
                                                                       ^
    x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/spotify._spotify.o -lspotify -o build/lib.linux-x86_64-2.7/spotify/_spotify.so
  Running setup.py install for cffi
    building '_cffi_backend' extension
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DUSE__THREAD -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-x86_64-2.7/c/_cffi_backend.o
    c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-F7nADM/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-iHQ5kx-record/install-record.txt --single-version-externally-managed --compile --user:
    running install

running build

running build_py

creating build

creating build/lib.linux-x86_64-2.7

creating build/lib.linux-x86_64-2.7/cffi

copying cffi/vengine_cpy.py -> build/lib.linux-x86_64-2.7/cffi

copying cffi/model.py -> build/lib.linux-x86_64-2.7/cffi

copying cffi/commontypes.py -> build/lib.linux-x86_64-2.7/cffi

copying cffi/backend_ctypes.py -> build/lib.linux-x86_64-2.7/cffi

copying cffi/cparser.py -> build/lib.linux-x86_64-2.7/cffi

copying cffi/ffiplatform.py -> build/lib.linux-x86_64-2.7/cffi

copying cffi/vengine_gen.py -> build/lib.linux-x86_64-2.7/cffi

copying cffi/gc_weakref.py -> build/lib.linux-x86_64-2.7/cffi

copying cffi/api.py -> build/lib.linux-x86_64-2.7/cffi

copying cffi/lock.py -> build/lib.linux-x86_64-2.7/cffi

copying cffi/__init__.py -> build/lib.linux-x86_64-2.7/cffi

copying cffi/setuptools_ext.py -> build/lib.linux-x86_64-2.7/cffi

copying cffi/cffi_opcode.py -> build/lib.linux-x86_64-2.7/cffi

copying cffi/verifier.py -> build/lib.linux-x86_64-2.7/cffi

copying cffi/recompiler.py -> build/lib.linux-x86_64-2.7/cffi

copying cffi/_cffi_include.h -> build/lib.linux-x86_64-2.7/cffi

copying cffi/parse_c_type.h -> build/lib.linux-x86_64-2.7/cffi

copying cffi/_embedding.h -> build/lib.linux-x86_64-2.7/cffi

running build_ext

building '_cffi_backend' extension

creating build/temp.linux-x86_64-2.7

creating build/temp.linux-x86_64-2.7/c

x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DUSE__THREAD -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-x86_64-2.7/c/_cffi_backend.o

c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory

compilation terminated.

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-F7nADM/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-iHQ5kx-record/install-record.txt --single-version-externally-managed --compile --user failed with error code 1 in /tmp/pip-build-F7nADM/cffi
Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 248, in main
    return command.main(cmd_args)
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 161, in main
    text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 64: ordinal not in range(128)

Control Spotify Connect Devices

Can i use this library to control other spotify connect devices.
Ideally I want a script to be run on Rpi2 and control a spotify client installed on a windows machine

Thanks !

how to

how do i use this project?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.