Warning
This page documents pyspotify's internal APIs. Its intended audience is developers working on pyspotify itself. You should not use anything you find on this page in your own applications.
The CFFI wrapper for the full libspotify API is available as spotify.ffi
and spotify.lib
.
spotify.ffi
cffi.FFI
instance which knows about libspotify types.
>>> import spotify
>>> spotify.ffi.new('sp_audioformat *')
<cdata 'struct sp_audioformat *' owning 12 bytes>
spotify.lib
Dynamic wrapper around the full libspotify C API.
>>> import spotify
>>> msg = spotify.lib.sp_error_message(spotify.lib.SP_ERROR_OK)
>>> msg
<cdata 'char *' 0x7f29fd922cb5>
>>> spotify.ffi.string(msg)
'No error'
spotify.lib
will always reflect the contents of the spotify/api.processed.h
file in the pyspotify distribution. To update the API:
- Update the file
spotify/api.h
with the latest header file from libspotify. Run the Invoke task
preprocess_header
defined intasks.py
by running:invoke preprocess_header
The task will update the
spotify/api.processed.h
file.- Commit both header files so that they are distributed with pyspotify.
spotify.serialized
spotify.utils.EventEmitter
spotify.utils.IntEnum
spotify.utils.make_enum
spotify.utils.load
spotify.utils.Sequence
spotify.utils.get_with_fixed_buffer
spotify.utils.get_with_growing_buffer
spotify.utils.to_bytes
spotify.utils.to_bytes_or_none
spotify.utils.to_unicode
spotify.utils.to_unicode_or_none
spotify.utils.to_char
spotify.utils.to_char_or_null
spotify.utils.to_country
spotify.utils.to_country_code