pyspotify v2.0.0b1 released, with new event loop and audio sinks

pyspotify 2.x is a full rewrite of pyspotify. While pyspotify 1.x is a CPython C extension, pyspotify 2.x uses CFFI to make 100% of the libspotify C library available from Python. It works on CPython 2.7 and 3.2+, as well as PyPy 2.1+.

pyspotify provides a Python interface to Spotify’s online music streaming service. With it you can access music metadata, search in Spotify’s library of 20+ million tracks, manage your Spotify playlists, and play music from Spotify. All from your own Python applications.

Since the previous release, pyspotify has become thread safe. That is, pyspotify can safely be used from multiple threads. The added thread safety made an integrated event loop possible, which greatly simplifies the usage of pyspotify, as can be seen from the updated example in examples/shell.py. Audio sink helpers for ALSA and PortAudio have been added, together with updated examples that can play music. A number of bugs have been fixed, and at the time of the release, there are no known issues. For more details, see the full changelog.

The pyspotify 2.0.0b1 release marks the completion of all planned features for pyspotify 2.x. The plans for the next releases are fixing bugs as they surface, incrementally improving the documentation, and integrating feedback from increased usage of the library in the wild.

I’d love it if you would give pyspotify 2.x a spin and report any issues you find.

To get started, check out the installation instructions for some help on the C library part of the installation, then continue on with the quickstart guide, and finally the complete API reference.

Happy music hacking!

Comics v2.3.0 released with better mobile support

Version 2.3.0 of my comics aggregator is now released. As always, dependencies have been updated, including the routine Django upgrade from Django 1.5 to 1.6, just in time for the upcoming 1.7 release. The largest change this time around is the move from Bootstrap 2 to 3, which includes a refreshed, flatter design and lots of tweaking to make Comics both look good and work nicely on mobile devices, something it didn’t use to do.

The dependency overview at requires.io has been a great motivation for doing some maintenance work on Comics. The only dependency left outdated is django-registration, as 1.0 moves to class-based views, which requires some larger changes to my customizations. Thus, the upgrade of django-registration has been deferred together with the related upgrade of my vendorized copy of django-invitation.

Most, if not all, of the other dependencies seems to support Python 3 now, though some lack the right Trove classifiers in their PyPI registration, so they are not correctly labeled by requires.io. I found an open pull request for cssmin and a recent commit for django-compressor adding the missing Trove classifiers. I’ve also done my part to improve the Python 3 metadata by sending a pull request to django-bootstrap-form.

Check out the Comics project docs for more information about Comics and this release in particular.

New Python wrapper for libspotify

Today, after about nine months of working on it now and then, I uploaded the first alpha release of pyspotify 2.0 to PyPI.

pyspotify provides a Python interface to Spotify’s online music streaming service. With it you can access music metadata, search in Spotify’s library of 20+ million tracks, manage your Spotify playlists, and play music from Spotify. All from your own Python applications.

pyspotify 2.x is a full rewrite of pyspotify. I know you’re not supposed to rewrite anything from scratch, but I did it anyway, and I admit that it took way more time than I anticipated. But, there are some huge differences between 1.x and 2.x: pyspotify 1.x is a CPython C extension with some Python padding. It only works on CPython 2.6 and 2.7. It relies quite a bit on providing your own subclasses to get callbacks from the library, etc. pyspotify 2.x uses CFFI to wrap the libspotify C library, and is written in pure Python. It works on CPython 2.7 and 3.2+, as well as PyPy 2.1+. There is no subclassing of anything, and it can be quite comfortably used from an interactive Python shell.

This first alpha release of pyspotify 2.0.0 makes 100% of the libspotify 12.1.51 API available from Python, going far beyond the API coverage of pyspotify 1.x. So, if you’ve longed for writing your own Spotify client with offline support, now is the time.

pyspotify 2.x has an extensive test suite with 98% line coverage. All tests pass on all combinations of CPython 2.7, 3.2, 3.3, PyPy 2.2 running on Linux on i386, amd64, armel, and armhf. Mac OS X should work, but has not been tested recently. I know there are bugs, and I’d like to hunt them down. Thus, I’d love it if you would give pyspotify 2.x a spin and report any issues over at GitHub.

To get started, check out the installation instructions for some help on the C library part of the installation, then continue on with the quickstart guide, and finally the complete API reference.

Happy hacking!

Archive

Archive of all posts