- Make
available_markets
ofShow <model.Show>
,LocalAlbum <model.LocalAlbum>
andLocalTrack <model.LocalTrack>
optional (323
)
- Add
ep
as a valid enum toAlbumType <model.AlbumType>
for top tracks API responses (318
) - Add undocumented
smart_shuffle
toCurrentlyPlayingContext <model.CurrentlyPlayingContext>
(320
)
- Support HTTPX
0.27
(317
)
reference
: remove methodsplaylist_remove_indices
andplaylist_remove_occurrences
, which were removed from the API (315
)
- Make
images
optional inPlaylist <model.Playlist>
to fix getting empty playlists without an image (309
) - Add undocumented
dict
to types ofpublisher
inShow <model.Show>
(310
) - Make
is_playable
inEpisode <model.Episode>
optional despite API specifications (310
) - Make deprecated
language
optional inEpisode <model.Episode>
pending removal (310
) - Add undocumented
dict
to types ofduration_ms
inLocalTrack <model.LocalTrack>
(310
) - Add undocumented
available_markets
toFullPlaylistEpisode <model.FullPlaylistEpisode>
(310
)
- Add
restrictions
toFullEpisode <model.FullEpisode>
(310
) - Support HTTPX
0.26
(311
) - Improve
UnknownModelAttributeWarning
to include model name (313
)
- Exclude Pydantic versions
2.5.0
and2.5.1
(306
) - Add missing
available_markets
toFullChapter <model.FullChapter>
(308
)
- Add undocumented
is_externally_hosted
attribute toAudiobook <model.Audiobook>
(302
) - Make
audio_preview_url
ofEpisode <model.Device>
optional (305
)
- Add support for short URLs as
is_short_link
andfollow_short_link <Spotify.follow_short_link>
(301
)
- Make
Album <model.Album>
optional (300
)
- Support HTTPX
0.25
(294
)
- Remove misleading documentation on models (
295
) - Add missing
supports_volume
toDevice <model.Device>
(296
) - Exclude Pydantic version
2.4.0
(297
)
- Add missing
Optional
annotations to support Pydantic 2 (293
)
Tekore 5 comes with an overhauled response model system based on Pydantic. Although the underlying change is major, the primary usage of models remains unchanged. The new models are more robust and easier to maintain. However, with more careful data validation new issues may arise. Please submit them on GitHub.
- Remove support for Python 3.7 (EOL) (
292
) - Use Pydantic in response models (
279
)- Many type hints are fixed and improved.
- Instead of retaining unknown response attributes, they are now discarded. However, the same warning message is raised.
.json
and.asbuiltin
methods are replaced by Pydantic models'.json
and.dict
.- Models use the builtin
datetime
object directly. .pprint
and custom__repr__
are removed in favor of using Pydantic's own machinery.- The builtin list class is used everywhere instead of the old
ModelList
.
FullAlbum <model.FullAlbum>
- remove "album_group" attribute introduced in version 4.6.0 (291
)
- Make enumerations case insensitive (
285
) - Support HTTPX 0.24 (
289
)
FullChapter <model.FullChapter>
/SimpleChapter <model.SimpleChapter>
- change "restriction" to "restrictions" (286
)FullAlbum <model.FullAlbum>
- add undocumented "album_group" attribute (287
)
errors
- carry scope information withUnauthorised
(276
)client
- add new audiobook (client-audiobook
) and chapterclient-chapter
endpoints and "audiobook" as a valid search type. Note that audiobooks are currently only available in the US market. The APIs also seem to be unreliable. (277
)client
- add new get queue endpointplayback_queue <Spotify.playback_queue>
. Queue results seem inconsistent at this time. (278
)
models
- add missing "minute" resolution toReleaseDatePrecision <model.ReleaseDatePrecision>
(277
)models
- parse response models safely everywhere (280
)client
- fix chunking of empty inputs (281
)
- Handle changed response to fix paging at search limit (
275
)
- Dependency to HTTPX upgraded to include version
0.23.*
(272
) - Declare support for Python 3.10 (
273
)
- Dependency to HTTPX upgraded to include version
0.22.*
(267
) - Expose the underlying credentials manager in
RefreshingCredentials
andRefreshingToken
to facilitate closing their HTTP client, which is no longer closed by default as of HTTPX version0.22
(267
)
- Add missing context "collection" to
ContextType <model.ContextType>
for playing saved tracks (270
)
conversions
- adduser
as a valid ID type and URL-encode hashes of user IDs into_url
(266
)
- URL-encode hashes in user IDs in
user <Spotify.user>
(266
)
- Dependency to HTTPX upgraded to include versions
0.20.0-0.21.*
(263
,265
)
Tekore 4.0 is a maintenance release to prepare for the nearly deprecated Python 3.6, update dependencies and improve backwards compatibility.
- Removed Python 3.6 support and its conditional dependencies (
252
) - Dependency to HTTPX upgraded to include versions from
0.15
to0.19.*
(250
,261
) - Add fields to
Request
and change their meaning to be in line with the new HTTPX interface (250
)
- Improved documentation for type hints and response models (
109
) - Responses can now parse unknown attributes, greatly improving backwards compatibility.
UnknownModelAttributeWarning <tekore.model.UnknownModelAttributeWarning>
was introduced (247
)
models
- add missing but undocumentedhtml_description
field toFullShow <model.FullShow>
andSimpleShow <model.SimpleShow>
(251
)models
- require the newly documentedhtml_description
field inFullEpisode <model.FullEpisode>
andSimpleEpisode <model.SimpleEpisode>
(251
)
client
- add the new market API (249
)client
- add episode endpoints to library API, and the correspondingSavedEpisode <model.SavedEpisode>
andSavedEpisodePaging <model.SavedEpisodePaging>
models (249
)
models
- add missing but undocumentedhtml_description
field toFullEpisode <model.FullEpisode>
andSimpleEpisode <model.SimpleEpisode>
(246
)
auth
- allow missing scope in token responses and parse it to an emptyScope
(245
)
client
- make context managers async safe on Python 3.7+, adds a dependency to thecontextvars
backport for Python 3.6 (242
)- Dependency to HTTPX upgraded to include version
0.17.*
(243
)
client
- document decreased limit ofsearch <Spotify.search>
total (241
)
auth
- addstreaming <scope.streaming>
andapp-remote-control <scope.app_remote_control>
as extra scopes (237
)
client
- fix type hints for context managers (239
)
models
- fix model repr for optional lists (233
)
client
- document the need for at least one seed inrecommendations <Spotify.recommendations>
(229
)client
- match new behavior of track markets (231
)
conversions
- ignore URL parameters infrom_url
(226
)conversions
-from_uri
,from_url
raise proper errors with entirely invalid formats, error messages were improved (227
)
client
- document new behavior of track markets (228
)
config
- warning messages for missing configuration now include the variable name which was missing (222
)models
- improved type hints and documentation of potentially missing values (221
)
client
- document new behavior of track markets (217
)
- Support Python 3.9 (
219
) - Dependency to HTTPX upgraded to include versions
0.15.*
and0.16.*
(216
) - Error messages for
parse_code_from_url
,parse_state_from_url
andCredentials.pkce_user_authorisation
were improved (218
) Spotify
andsenders
, both synchronous and asynchronous, can now be closed directly withclose <Spotify.close>
(220
)
StrEnum <model.StrEnum>
- model enumerations now inherit fromstr
, making e.g. using it as a key for sorting possible (214
)
PrivateUser <model.PrivateUser>
- a birthday attribute was added. It is not obtainable with new tokens but is returned for old tokens that have the now-invaliduser-read-birthday
scope (52
,197
)
featured_playlists <Spotify.featured_playlists>
- allow missing owner inPlaylist <model.Playlist>
models (212
)
The next major iteration of Tekore brings fewer breaking changes than in 2.0, but packs a number of improvements to authorisation and senders. Most notably, PKCE is now provided as an option for user authorisation and Requests is no longer used to perform web requests. HTTPX, which was already in use with async, is used exclusively instead.
auth
- PKCE can be used in user authorisation, providing added security for public clients by removing the need to use a client secret. (189
)UserAuth
- implement user authorisation with security checks, the caller simply provides the resulting URI after redirection (207
)senders
- Tekore's ownRequest
andResponse
wrappers are now used in the sender interface (139
)- Classes now have a readable
repr
(191
) - Dependency to HTTPX upgraded to include version
0.14.*
(202
) gen_state
- generate state for user authorisation (207
)parse_state_from_url
- parse state from URL parameters (207
)
client-playlist
- methods for playlist tracks andepisodes_as_tracks
argument ofSpotify.playlist
deprecated in 2.0 (178
,202
)- Dependency to Requests dropped in favor of HTTPX (
139
) senders
-TransientSender
andSingletonSender
along with their asynchronous variants were removed (139
)senders
- default sender and keyword argument options were removed (139
)
errors
- web exceptions now inherit fromException
rather than the underlying HTTP library's top-level exception. They always contain the relevantRequest
andResponse
(139
)senders
- as the only concrete senders,PersistentSender
andAsyncPersistentSender
are now implemented inSyncSender
andAsyncSender
, respectively (139
)CachingSender
- argument order is now in line withRetryingSender
(139
)senders
- clients (Spotify
andCredentials
) now inherit fromExtendingSender
(139
)auth
- raise a more descriptive error if secret is required but not provided (210
)
client
- fix chunking errors that occurred when passing certain parameters as positional arguments (205
)
client
- correctly returnModelList <model.ModelList>
when chunking input (196
)auth
- fix error handling when response does not contain an error description (199
)playback <Spotify.playback>
andplayback_currently_playing <Spotify.playback_currently_playing>
-correctly handle local tracks (200
)
FullShow <model.FullShow>
- add undocumentedtotal_episodes
parameter, marktotal_episodes
ofSimpleShow <model.SimpleShow>
undocumented (194
)
SimpleShow <model.SimpleShow>
- add optionaltotal_episodes
parameter (190
)
client
- required and optional scopes can now be determined in code for any endpoint of the client (180
)- Dependency to HTTPX upgraded to include version
0.13.*
(186
)
errors
- correctly fall back toClientError
andServerError
when encountering an unknown status code (185
)
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
.
- Importing from submodules (
81
) OAuthError
inauth
- see below for details (154
)
client-playlist
- methods specifically for playlist tracks andepisodes_as_tracks
argument ofSpotify.playlist
(178
)
auth
- a list ofscopes <scope>
and strings is accepted in scope arguments (81
)Scope
operations were expanded to properly handle all combinations ofstr
,scope
andScope
(177
)client-playlist
- new methods to fully support episodes in playlists. The new endpoints are direct counterparts toplaylist_tracks_*
methods. (178
)
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
andconfig
are now set at the top level AuthorisationScopes
was renamed toscope
, and its alias scopes is no longer available- Ready-made
scopes <auth-scopes>
read, write and every are now accessed via thescope
enumeration
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 theirjson <model.Serialisable.json>
method - As a result of the change above, the
repr
of models can be viewed simply withprint
. Therepr
of model lists was significantly improved. Viewing attributes of models produces consistent results. - The
asbuiltin <model.Serialisable.asbuiltin>
method replacesasdict
for models and was also added for lists of models. Enumerations and timestamps are no longer preserved in the conversion. pprint <model.Serialisable.pprint>
output is now compact by default
Boolean attributes of FullTrack <model.FullTrack>
and FullEpisode <model.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 <model.FullPlaylistTrack>
and FullPlaylistEpisode <model.FullPlaylistEpisode>
. LocalPlaylistTrack <model.LocalPlaylistTrack>
now also provides these booleans. (170
)
- Exceptions thrown in
auth
now matchclient
. Because of that,OAuthError
was removed.errors
now inherit from a common base class. (154
) Token.scope
andRefreshingToken.scope
now return aScope
instead of a string. (177
)- Default
sender <senders>
changed fromTransientSender
toPersistentSender
, also affectsClient
behavior (141
)
- Properly close sessions in
PersistentSender
(179
) - Members of
AlbumGroup <model.AlbumGroup>
are now strings as intended, rather than one-element tuples (181
) - Include readme to source distributions to fix setup (
182
)
- Most imports can be done directly at the top level (
174
)
- Importing from submodules, removed in Tekore 2.0 (
81
)
recommendations <Spotify.recommendations>
documentation changed to reflect that only IDs are accepted as seeds, not URIs or URLs (173
)track_audio_analysis <Spotify.track_audio_analysis>
allow for missing attributes in analysis (175
)
client
- Support for podcasts. New APIs forepisodes <client-episode>
andshows <client-show>
. Newscope
user-read-playback-position
for returning episode resume points. New endpoints for saving shows in a user'slibrary <client-library>
.playback_queue_add <Spotify.playback_queue_add>
now accepts episodes.playback <Spotify.playback>
andplayback_currently_playing <Spotify.playback_currently_playing>
can return currently playing episodes and shows.playlist <Spotify.playlist>
andplaylist_tracks <Spotify.playlist_tracks>
can return episodes on playlists.search <Spotify.search>
allows for searching episodes and shows. (164
)- Dependency to HTTPX upgraded to include version
0.12.*
(166
)
- Errors are now correctly raised when parsing responses in
playlist <Spotify.playlist>
andplaylist_tracks <Spotify.playlist_tracks>
(164
) - Conversions
to_url
now return URLs with prefixhttps
instead ofhttp
, in line with API and application behavior.from_url
now correctly acceptshttps
addresses for conversion. (165
) models
- Therepr
of local items can now be produced without errors (171
)
RetryingSender
-avoid unnecessary retries and reduce total wait time (163
)
category_playlists <Spotify.category_playlists>
require category parameter (160
)AsyncPersistentSender
-persist connections appropriately (161
)playback_queue_add <Spotify.playback_queue_add>
match endpoint address to changed API (162
)
playlist_tracks_clear <Spotify.playlist_tracks_clear>
-convenience endpoint for deleting tracks from a playlist (155
)conversions
- accept shows and episodes as valid types (159
)
playlist_tracks_add <Spotify.playlist_tracks_add>
-insert tracks in correct order when chunking (156
)
playback_queue_add <Spotify.playback_queue_add>
-add tracks to queue (152
)models
- readablerepr
for models (32911c3a
)CachingSender
- option to specify maximum cache size (143
)client
- optionally send long lists of resources as chunks circumventing API limits (153
)
client
- optionally use maximum limits in all paging calls (66
)
client-paging
- respect API limits when retrieving all items or pages of asearch <Spotify.search>
(145
)client-paging
- always return an awaitable when asynchronous (146
)
- Async support in authentication and API endpoints (
131
) CachingSender
- a sender for response caching (4
)config
- reading missing values produces a warning (0fa61801
)
playlist <Spotify.playlist>
-parse correctly when fields is specified (142
)
PlaylistTrack <model.PlaylistTrack>
-accept missing video thumbnail (132
)
- Packaging improvements
- Declare versioning scheme
Initial release of Tekore!