Skip to content

2.0.0 - The future is here

Compare
Choose a tag to compare
@felix-hilden felix-hilden released this 27 May 15:35
· 236 commits to master since this release

This release significantly improves the overall structure of the library and provides quality of life enhancements to various tasks. Most notably, submodules were removed in favor of a flat structure. Everything is now imported from the top level with the exception of models.

Removed

  • Importing from submodules (#81)
  • OAuthError in auth - see below for details (#154)

Deprecated

  • Playlist API - methods specifically for playlist tracks and episodes_as_tracks argument of Spotify.playlist (#178)

Added

  • Authentication - a list of scopes and strings is accepted in scope arguments (#81)
  • Scope operations were expanded to properly handle all combinations of str, scope and Scope (#177)
  • Playlist API - new methods to fully support episodes in playlists. The new endpoints are direct counterparts to playlist_tracks_* methods. (#178)

Changed

Import structure

Submodules were removed in favor of a flat structure. In addition to simply relocating objects, some changes were made as well. (#81)

  • Options for senders and configuration are now set at the top level
  • AuthorisationScopes was renamed toscope, and its alias scopes is no longer available
  • Ready-made scopes read, write and every are now accessed via the scope enumeration

Response models

These changes aim to make models consistent and serialisation clear. (#149)

  • The JSON encoder used internally was made private
  • Hierarchies and names of model base classes and member types changed
  • Instead of using str, models are now converted to JSON using their json method
  • As a result of the change above, the repr of models can be viewed simply with print. The repr of model lists was significantly improved. Viewing attributes of models produces consistent results.
  • The asbuiltin method replaces asdict for models and was also added for lists of models. Enumerations and timestamps are no longer preserved in the conversion.
  • pprint output is now compact by default

Playlist items

Boolean attributes of FullTrack and FullEpisode on a playlist were previously also available elsewhere, but had None values. They were removed. The booleans are still available in playlist-related calls with the new FullPlaylistTrack and FullPlaylistEpisode. LocalPlaylistTrack now also provides these booleans. (#170)

Miscellaneous

  • Exceptions thrown in authentication now match client. Because of that, OAuthError was removed. Errors now inherit from a common base class. (#154)
  • Token.scope and RefreshingToken.scope now return a Scope instead of a string. (#177)
  • Default sender changed from TransientSender to PersistentSender, also affects Client behavior (#141)

Fixed

  • Properly close sessions in PersistentSender (#179)
  • Members of AlbumGroup are now strings as intended, rather than one-element tuples (#181)
  • Include readme to source distributions to fix setup (#182)