Models

Response model definitions for client.

Responses are parsed into Pydantic models. This allows accessing parts of the response directly as attributes. Further documentation on specific attribute values can be viewed in the Web API reference.

import tekore as tk

# Call the API
spotify = tk.Spotify(token)
album = spotify.album('3RBULTZJ97bvVzZLpxcB0j')

# Use the response
for track in album.tracks.items:
    print(track.track_number, track.name)

Using Pydantic models means that responses are easy to work with. They provide a readable repr (particularly with devtools) for quick inspection, and it is also possible to convert models to builtin and JSON representations:

from pprint import pprint

print(album)
pprint(album, depth=2)

album.dict()
album.json()

Responses will sometimes contain unknown attributes when the API changes. They are ignored when parsing the response model, but a UnknownModelAttributeWarning is issued when encountering one. Please consider upgrading Tekore if a newer version documents and handles it.

Models are made available in the tekore.models namespace.

Album

Album

Album base.

AlbumGroup

Relationship between artist and album.

AlbumType

Type of album.

SimpleAlbum

Simplified album object.

SimpleAlbumPaging

Paging containing simplified albums.

FullAlbum

Complete album object.

SavedAlbum

Album saved to library.

SavedAlbumPaging

Paging of albums in library.

class tekore.model.Album(*, id, href, type, uri, album_type, artists, external_urls, images, name, total_tracks, release_date, release_date_precision, available_markets=None, is_playable=None)

Bases: tekore.model.Item

Album base.

Parameters
  • id (str) –

  • href (str) –

  • type (str) –

  • uri (str) –

  • album_type (AlbumType) –

  • artists (List[SimpleArtist]) –

  • external_urls (dict) –

  • images (List[Image]) –

  • name (str) –

  • total_tracks (int) –

  • release_date (str) –

  • release_date_precision (ReleaseDatePrecision) –

  • available_markets (Optional[List[str]]) –

  • is_playable (Optional[bool]) –

Return type

None

class tekore.model.AlbumGroup(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: tekore.model.StrEnum

Relationship between artist and album.

album = 'album'
appears_on = 'appears_on'
compilation = 'compilation'
single = 'single'
class tekore.model.AlbumType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: tekore.model.StrEnum

Type of album.

album = 'album'
compilation = 'compilation'
single = 'single'
class tekore.model.SimpleAlbum(*, id, href, type, uri, album_type, artists, external_urls, images, name, total_tracks, release_date, release_date_precision, available_markets=None, is_playable=None, album_group=None)

Bases: tekore.model.Album

Simplified album object.

album_group is available when getting an artist’s albums. available_markets is available when market is not specified.

The presence of is_playable is undocumented and it appears to only be True when it is present.

Parameters
  • id (str) –

  • href (str) –

  • type (str) –

  • uri (str) –

  • album_type (AlbumType) –

  • artists (List[SimpleArtist]) –

  • external_urls (dict) –

  • images (List[Image]) –

  • name (str) –

  • total_tracks (int) –

  • release_date (str) –

  • release_date_precision (ReleaseDatePrecision) –

  • available_markets (Optional[List[str]]) –

  • is_playable (Optional[bool]) –

  • album_group (Optional[AlbumGroup]) –

Return type

None

class tekore.model.SimpleAlbumPaging(*, href, items, limit, next, total, offset, previous)

Bases: tekore.model.OffsetPaging

Paging containing simplified albums.

Parameters
  • href (str) –

  • items (List[SimpleAlbum]) –

  • limit (int) –

  • next (Optional[str]) –

  • total (int) –

  • offset (int) –

  • previous (Optional[str]) –

Return type

None

class tekore.model.FullAlbum(*, id, href, type, uri, album_type, artists, external_urls, images, name, total_tracks, release_date, release_date_precision, available_markets=None, is_playable=None, copyrights, external_ids, genres, label, popularity, tracks)

Bases: tekore.model.Album

Complete album object.

available_markets is available when market is not specified.

The presence of is_playable is undocumented and it appears to only be True when it is present.

Parameters
  • id (str) –

  • href (str) –

  • type (str) –

  • uri (str) –

  • album_type (AlbumType) –

  • artists (List[SimpleArtist]) –

  • external_urls (dict) –

  • images (List[Image]) –

  • name (str) –

  • total_tracks (int) –

  • release_date (str) –

  • release_date_precision (ReleaseDatePrecision) –

  • available_markets (Optional[List[str]]) –

  • is_playable (Optional[bool]) –

  • copyrights (List[Copyright]) –

  • external_ids (dict) –

  • genres (List[str]) –

  • label (Optional[str]) –

  • popularity (int) –

  • tracks (SimpleTrackPaging) –

Return type

None

class tekore.model.SavedAlbum(*, added_at, album)

Bases: tekore.model.Model

Album saved to library.

Parameters
  • added_at (datetime.datetime) –

  • album (FullAlbum) –

Return type

None

class tekore.model.SavedAlbumPaging(*, href, items, limit, next, total, offset, previous)

Bases: tekore.model.OffsetPaging

Paging of albums in library.

Parameters
  • href (str) –

  • items (List[SavedAlbum]) –

  • limit (int) –

  • next (Optional[str]) –

  • total (int) –

  • offset (int) –

  • previous (Optional[str]) –

Return type

None

Artist

Artist

Artist base.

SimpleArtist

Simplified artist object.

FullArtist

Complete artist object.

FullArtistCursorPaging

Paging of full artists.

FullArtistOffsetPaging

Paging of full artists.

class tekore.model.Artist(*, id, href, type, uri, external_urls, name)

Bases: tekore.model.Item

Artist base.

Parameters
  • id (str) –

  • href (str) –

  • type (str) –

  • uri (str) –

  • external_urls (dict) –

  • name (str) –

Return type

None

class tekore.model.SimpleArtist(*, id, href, type, uri, external_urls, name)

Bases: tekore.model.Artist

Simplified artist object.

Parameters
  • id (str) –

  • href (str) –

  • type (str) –

  • uri (str) –

  • external_urls (dict) –

  • name (str) –

Return type

None

class tekore.model.FullArtist(*, id, href, type, uri, external_urls, name, followers, genres, images, popularity)

Bases: tekore.model.Artist

Complete artist object.

Parameters
  • id (str) –

  • href (str) –

  • type (str) –

  • uri (str) –

  • external_urls (dict) –

  • name (str) –

  • followers (Followers) –

  • genres (List[str]) –

  • images (List[Image]) –

  • popularity (int) –

Return type

None

class tekore.model.FullArtistCursorPaging(*, href, items, limit, next, cursors, total)

Bases: tekore.model.CursorPaging

Paging of full artists.

Parameters
  • href (str) –

  • items (List[FullArtist]) –

  • limit (int) –

  • next (Optional[str]) –

  • cursors (Cursor) –

  • total (int) –

Return type

None

class tekore.model.FullArtistOffsetPaging(*, href, items, limit, next, total, offset, previous)

Bases: tekore.model.OffsetPaging

Paging of full artists.

Parameters
  • href (str) –

  • items (List[FullArtist]) –

  • limit (int) –

  • next (Optional[str]) –

  • total (int) –

  • offset (int) –

  • previous (Optional[str]) –

Return type

None

Audiobook

Audiobook

Audiobook base.

SimpleAudiobook

Simplified audiobook.

SimpleAudiobookPaging

Paging of simplified audiobooks.

FullAudiobook

Complete audiobook object.

Author

Audiobook author.

Narrator

Audiobook narrator.

class tekore.model.Audiobook(*, id, href, type, uri, authors, available_markets=None, copyrights, description, edition, explicit, external_urls, html_description, images, is_externally_hosted=None, languages, media_type, name, narrators, publisher, total_chapters)

Bases: tekore.model.Item

Audiobook base.

Parameters
  • id (str) –

  • href (str) –

  • type (str) –

  • uri (str) –

  • authors (List[Author]) –

  • available_markets (Optional[List[str]]) –

  • copyrights (List[Copyright]) –

  • description (str) –

  • edition (Optional[str]) –

  • explicit (bool) –

  • external_urls (dict) –

  • html_description (str) –

  • images (List[Image]) –

  • is_externally_hosted (Optional[bool]) –

  • languages (List[str]) –

  • media_type (str) –

  • name (str) –

  • narrators (List[Narrator]) –

  • publisher (str) –

  • total_chapters (Optional[int]) –

Return type

None

class tekore.model.SimpleAudiobook(*, id, href, type, uri, authors, available_markets=None, copyrights, description, edition, explicit, external_urls, html_description, images, is_externally_hosted=None, languages, media_type, name, narrators, publisher, total_chapters, chapters=None)

Bases: tekore.model.Audiobook

Simplified audiobook.

May contain chapters, but that is likely an error.

Parameters
  • id (str) –

  • href (str) –

  • type (str) –

  • uri (str) –

  • authors (List[Author]) –

  • available_markets (Optional[List[str]]) –

  • copyrights (List[Copyright]) –

  • description (str) –

  • edition (Optional[str]) –

  • explicit (bool) –

  • external_urls (dict) –

  • html_description (str) –

  • images (List[Image]) –

  • is_externally_hosted (Optional[bool]) –

  • languages (List[str]) –

  • media_type (str) –

  • name (str) –

  • narrators (List[Narrator]) –

  • publisher (str) –

  • total_chapters (Optional[int]) –

  • chapters (Optional[dict]) –

Return type

None

class tekore.model.SimpleAudiobookPaging(*, href, items, limit, next, total, offset, previous)

Bases: tekore.model.OffsetPaging

Paging of simplified audiobooks.

Parameters
  • href (str) –

  • items (List[SimpleAudiobook]) –

  • limit (int) –

  • next (Optional[str]) –

  • total (int) –

  • offset (int) –

  • previous (Optional[str]) –

Return type

None

class tekore.model.FullAudiobook(*, id, href, type, uri, authors, available_markets=None, copyrights, description, edition, explicit, external_urls, html_description, images, is_externally_hosted=None, languages, media_type, name, narrators, publisher, total_chapters, chapters)

Bases: tekore.model.Audiobook

Complete audiobook object.

Parameters
  • id (str) –

  • href (str) –

  • type (str) –

  • uri (str) –

  • authors (List[Author]) –

  • available_markets (Optional[List[str]]) –

  • copyrights (List[Copyright]) –

  • description (str) –

  • edition (Optional[str]) –

  • explicit (bool) –

  • external_urls (dict) –

  • html_description (str) –

  • images (List[Image]) –

  • is_externally_hosted (Optional[bool]) –

  • languages (List[str]) –

  • media_type (str) –

  • name (str) –

  • narrators (List[Narrator]) –

  • publisher (str) –

  • total_chapters (Optional[int]) –

  • chapters (SimpleChapterPaging) –

Return type

None

class tekore.model.Author(*, name)

Bases: tekore.model.Model

Audiobook author.

Parameters

name (str) –

Return type

None

class tekore.model.Narrator(*, name)

Bases: tekore.model.Model

Audiobook narrator.

Parameters

name (str) –

Return type

None

Category

Category

Spotify tag category.

CategoryPaging

Paging of categories.

class tekore.model.Category(*, id, href, icons, name)

Bases: tekore.model.Identifiable

Spotify tag category.

Parameters
  • id (str) –

  • href (str) –

  • icons (List[Image]) –

  • name (str) –

Return type

None

class tekore.model.CategoryPaging(*, href, items, limit, next, total, offset, previous)

Bases: tekore.model.OffsetPaging

Paging of categories.

Parameters
  • href (str) –

  • items (List[Category]) –

  • limit (int) –

  • next (Optional[str]) –

  • total (int) –

  • offset (int) –

  • previous (Optional[str]) –

Return type

None

Chapter

Chapter

Audiobook chapter base.

SimpleChapter

Simplified chapter.

SimpleChapterPaging

Paging of simplified chapters.

FullChapter

Complete chapter object.

class tekore.model.Chapter(*, id, href, type, uri, audio_preview_url, available_markets=None, chapter_number, description, duration_ms, explicit, external_urls, html_description, images, is_playable=None, languages, name, release_date_precision, release_date, restrictions=None, resume_point)

Bases: tekore.model.Item

Audiobook chapter base.

Parameters
  • id (str) –

  • href (str) –

  • type (str) –

  • uri (str) –

  • audio_preview_url (Optional[str]) –

  • available_markets (Optional[List[str]]) –

  • chapter_number (int) –

  • description (str) –

  • duration_ms (int) –

  • explicit (bool) –

  • external_urls (dict) –

  • html_description (str) –

  • images (List[Image]) –

  • is_playable (Optional[bool]) –

  • languages (List[str]) –

  • name (str) –

  • release_date_precision (ReleaseDatePrecision) –

  • release_date (str) –

  • restrictions (Optional[Restrictions]) –

  • resume_point (ResumePoint) –

Return type

None

class tekore.model.SimpleChapter(*, id, href, type, uri, audio_preview_url, available_markets=None, chapter_number, description, duration_ms, explicit, external_urls, html_description, images, is_playable=None, languages, name, release_date_precision, release_date, restrictions=None, resume_point)

Bases: tekore.model.Chapter

Simplified chapter.

Parameters
  • id (str) –

  • href (str) –

  • type (str) –

  • uri (str) –

  • audio_preview_url (Optional[str]) –

  • available_markets (Optional[List[str]]) –

  • chapter_number (int) –

  • description (str) –

  • duration_ms (int) –

  • explicit (bool) –

  • external_urls (dict) –

  • html_description (str) –

  • images (List[Image]) –

  • is_playable (Optional[bool]) –

  • languages (List[str]) –

  • name (str) –

  • release_date_precision (ReleaseDatePrecision) –

  • release_date (str) –

  • restrictions (Optional[Restrictions]) –

  • resume_point (ResumePoint) –

Return type

None

class tekore.model.SimpleChapterPaging(*, href, items, limit, next, total, offset, previous)

Bases: tekore.model.OffsetPaging

Paging of simplified chapters.

Parameters
  • href (str) –

  • items (List[SimpleChapter]) –

  • limit (int) –

  • next (Optional[str]) –

  • total (int) –

  • offset (int) –

  • previous (Optional[str]) –

Return type

None

class tekore.model.FullChapter(*, id, href, type, uri, audio_preview_url, available_markets=None, chapter_number, description, duration_ms, explicit, external_urls, html_description, images, is_playable=None, languages, name, release_date_precision, release_date, restrictions=None, resume_point, audiobook)

Bases: tekore.model.Chapter

Complete chapter object.

Parameters
  • id (str) –

  • href (str) –

  • type (str) –

  • uri (str) –

  • audio_preview_url (Optional[str]) –

  • available_markets (Optional[List[str]]) –

  • chapter_number (int) –

  • description (str) –

  • duration_ms (int) –

  • explicit (bool) –

  • external_urls (dict) –

  • html_description (str) –

  • images (List[Image]) –

  • is_playable (Optional[bool]) –

  • languages (List[str]) –

  • name (str) –

  • release_date_precision (ReleaseDatePrecision) –

  • release_date (str) –

  • restrictions (Optional[Restrictions]) –

  • resume_point (ResumePoint) –

  • audiobook (SimpleAudiobook) –

Return type

None

Episode

Episode

Episode base.

SimpleEpisode

Simplified episode object.

SimpleEpisodePaging

Paging of simplified episodes.

FullEpisode

Complete episode object.

SavedEpisode

Episode saved to library.

SavedEpisodePaging

Paging of episodes in library.

ResumePoint

Resume point.

class tekore.model.Episode(*, id, href, type, uri, audio_preview_url, description, duration_ms, explicit, external_urls, html_description, images, is_externally_hosted, is_playable=None, language=None, languages, name, release_date, release_date_precision, resume_point=None)

Bases: tekore.model.Item

Episode base.

language is deprecated.

Parameters
  • id (str) –

  • href (str) –

  • type (str) –

  • uri (str) –

  • audio_preview_url (Optional[str]) –

  • description (str) –

  • duration_ms (int) –

  • explicit (bool) –

  • external_urls (dict) –

  • html_description (str) –

  • images (List[Image]) –

  • is_externally_hosted (bool) –

  • is_playable (Optional[bool]) –

  • language (Optional[str]) –

  • languages (List[str]) –

  • name (str) –

  • release_date (str) –

  • release_date_precision (ReleaseDatePrecision) –

  • resume_point (Optional[ResumePoint]) –

Return type

None

class tekore.model.SimpleEpisode(*, id, href, type, uri, audio_preview_url, description, duration_ms, explicit, external_urls, html_description, images, is_externally_hosted, is_playable=None, language=None, languages, name, release_date, release_date_precision, resume_point=None)

Bases: tekore.model.Episode

Simplified episode object.

Parameters
  • id (str) –

  • href (str) –

  • type (str) –

  • uri (str) –

  • audio_preview_url (Optional[str]) –

  • description (str) –

  • duration_ms (int) –

  • explicit (bool) –

  • external_urls (dict) –

  • html_description (str) –

  • images (List[Image]) –

  • is_externally_hosted (bool) –

  • is_playable (Optional[bool]) –

  • language (Optional[str]) –

  • languages (List[str]) –

  • name (str) –

  • release_date (str) –

  • release_date_precision (ReleaseDatePrecision) –

  • resume_point (Optional[ResumePoint]) –

Return type

None

class tekore.model.SimpleEpisodePaging(*, href, items, limit, next, total, offset, previous)

Bases: tekore.model.OffsetPaging

Paging of simplified episodes.

Parameters
  • href (str) –

  • items (List[SimpleEpisode]) –

  • limit (int) –

  • next (Optional[str]) –

  • total (int) –

  • offset (int) –

  • previous (Optional[str]) –

Return type

None

class tekore.model.FullEpisode(*, id, href, type, uri, audio_preview_url, description, duration_ms, explicit, external_urls, html_description, images, is_externally_hosted, is_playable=None, language=None, languages, name, release_date, release_date_precision, resume_point=None, restrictions=None, show)

Bases: tekore.model.Episode

Complete episode object.

Parameters
  • id (str) –

  • href (str) –

  • type (str) –

  • uri (str) –

  • audio_preview_url (Optional[str]) –

  • description (str) –

  • duration_ms (int) –

  • explicit (bool) –

  • external_urls (dict) –

  • html_description (str) –

  • images (List[Image]) –

  • is_externally_hosted (bool) –

  • is_playable (Optional[bool]) –

  • language (Optional[str]) –

  • languages (List[str]) –

  • name (str) –

  • release_date (str) –

  • release_date_precision (ReleaseDatePrecision) –

  • resume_point (Optional[ResumePoint]) –

  • restrictions (Optional[Restrictions]) –

  • show (SimpleShow) –

Return type

None

class tekore.model.SavedEpisode(*, added_at, episode)

Bases: tekore.model.Model

Episode saved to library.

Parameters
  • added_at (datetime.datetime) –

  • episode (FullEpisode) –

Return type

None

class tekore.model.SavedEpisodePaging(*, href, items, limit, next, total, offset, previous)

Bases: tekore.model.OffsetPaging

Paging of episodes in library.

Parameters
  • href (str) –

  • items (List[SavedEpisode]) –

  • limit (int) –

  • next (Optional[str]) –

  • total (int) –

  • offset (int) –

  • previous (Optional[str]) –

Return type

None

class tekore.model.ResumePoint(*, fully_played, resume_position_ms)

Bases: tekore.model.Model

Resume point.

Parameters
  • fully_played (bool) –

  • resume_position_ms (int) –

Return type

None

Playback

CurrentlyPlaying

Current playback.

CurrentlyPlayingContext

Extended current playback context.

CurrentlyPlayingType

Type of currently playing item.

Queue

Playback queue.

Device

Playback device.

DeviceType

Type of playback device.

Actions

Player actions.

Disallows

Disallowed player actions.

PlayerErrorReason

Reasons for errors in player actions.

RepeatState

Playback repeat state.

PlayHistory

Previously played track.

PlayHistoryCursor

Cursor to play history.

PlayHistoryPaging

Paging to play history.

Context

Context of a played track or episode.

ContextType

Type of player context.

Currently playing

class tekore.model.CurrentlyPlaying(*, actions, currently_playing_type, is_playing, timestamp, context, progress_ms, item)

Bases: tekore.model.Model

Current playback.

context, progress_ms and item may be None e.g. during a private session.

Parameters
Return type

None

class tekore.model.CurrentlyPlayingContext(*, actions, currently_playing_type, is_playing, timestamp, context, progress_ms, item, device, repeat_state, shuffle_state)

Bases: tekore.model.CurrentlyPlaying

Extended current playback context.

Parameters
Return type

None

class tekore.model.CurrentlyPlayingType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: tekore.model.StrEnum

Type of currently playing item.

ad = 'ad'
episode = 'episode'
track = 'track'
unknown = 'unknown'
class tekore.model.Queue(*, currently_playing, queue)

Bases: tekore.model.Model

Playback queue.

Parameters
Return type

None

class tekore.model.Device(*, id, is_active, is_private_session, is_restricted, name, type, volume_percent, supports_volume)

Bases: tekore.model.Identifiable

Playback device.

Parameters
  • id (str) –

  • is_active (bool) –

  • is_private_session (bool) –

  • is_restricted (bool) –

  • name (str) –

  • type (DeviceType) –

  • volume_percent (Optional[int]) –

  • supports_volume (bool) –

Return type

None

class tekore.model.DeviceType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: tekore.model.StrEnum

Type of playback device.

AVR = 'AVR'
AudioDongle = 'AudioDongle'
Automobile = 'Automobile'
CastAudio = 'CastAudio'
CastVideo = 'CastVideo'
Computer = 'Computer'
GameConsole = 'GameConsole'
STB = 'STB'
Smartphone = 'Smartphone'
Speaker = 'Speaker'
TV = 'TV'
Tablet = 'Tablet'
Unknown = 'Unknown'
audiodongle = 'AudioDongle'
automobile = 'Automobile'
avr = 'AVR'
castaudio = 'CastAudio'
castvideo = 'CastVideo'
computer = 'Computer'
gameconsole = 'GameConsole'
smartphone = 'Smartphone'
speaker = 'Speaker'
stb = 'STB'
tablet = 'Tablet'
tv = 'TV'
unknown = 'Unknown'
class tekore.model.Actions(*, disallows)

Bases: tekore.model.Model

Player actions.

Parameters

disallows (Disallows) –

Return type

None

class tekore.model.Disallows(*, interrupting_playback=False, pausing=False, resuming=False, seeking=False, skipping_next=False, skipping_prev=False, toggling_repeat_context=False, toggling_shuffle=False, toggling_repeat_track=False, transferring_playback=False)

Bases: tekore.model.Model

Disallowed player actions.

Parameters
  • interrupting_playback (bool) –

  • pausing (bool) –

  • resuming (bool) –

  • seeking (bool) –

  • skipping_next (bool) –

  • skipping_prev (bool) –

  • toggling_repeat_context (bool) –

  • toggling_shuffle (bool) –

  • toggling_repeat_track (bool) –

  • transferring_playback (bool) –

Return type

None

class tekore.model.PlayerErrorReason(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: enum.Enum

Reasons for errors in player actions.

ALREADY_PAUSED = 'The command requires playback to not be paused.'
ALREADY_PLAYING = 'The track should not be restarted if the same track and context is already playing, and there is a resume point.'
CONTEXT_DISALLOW = 'The command could not be performed on the context.'
DEVICE_NOT_CONTROLLABLE = 'Not possible to remote control the device.'
ENDLESS_CONTEXT = 'The shuffle command cannot be applied on an endless context.'
NOT_PAUSED = 'The command requires playback to be paused.'
NOT_PLAYING_CONTEXT = 'The command requires that a context is currently playing.'
NOT_PLAYING_LOCALLY = 'The command requires playback on the local device.'
NOT_PLAYING_TRACK = 'The command requires that a track is currently playing.'
NO_ACTIVE_DEVICE = 'Requires an active device and the user has none.'
NO_NEXT_TRACK = 'The command requires a next track, but there is none in the context.'
NO_PREV_TRACK = 'The command requires a previous track, but there is none in the context.'
NO_SPECIFIC_TRACK = 'The requested track does not exist.'
PREMIUM_REQUIRED = 'The request is prohibited for non-premium users.'
RATE_LIMITED = 'The user is rate limited due to too frequent track play,also known as cat-on-the-keyboard spamming.'
REMOTE_CONTROL_DISALLOW = 'The context cannot be remote-controlled.'
UNKNOWN = 'Certain actions are restricted because of unknown reasons.'
VOLUME_CONTROL_DISALLOW = 'Not possible to remote control the device’s volume.'
class tekore.model.RepeatState(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: tekore.model.StrEnum

Playback repeat state.

context = 'context'
off = 'off'
track = 'track'

Play history

class tekore.model.PlayHistory(*, track, played_at, context)

Bases: tekore.model.Model

Previously played track.

Context is supposedly sometimes available.

Parameters
  • track (FullTrack) –

  • played_at (datetime.datetime) –

  • context (Optional[Context]) –

Return type

None

class tekore.model.PlayHistoryCursor(*, after, before)

Bases: tekore.model.Cursor

Cursor to play history.

Parameters
  • after (Optional[str]) –

  • before (str) –

Return type

None

class tekore.model.PlayHistoryPaging(*, href, items, limit, next, cursors)

Bases: tekore.model.CursorPaging

Paging to play history.

Cursors are not available when paging is exhausted.

Parameters
Return type

None

class tekore.model.Context(*, type, href, external_urls, uri)

Bases: tekore.model.Model

Context of a played track or episode.

Parameters
  • type (ContextType) –

  • href (str) –

  • external_urls (dict) –

  • uri (str) –

Return type

None

class tekore.model.ContextType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: tekore.model.StrEnum

Type of player context.

album = 'album'
artist = 'artist'
collection = 'collection'
playlist = 'playlist'
show = 'show'

Playlist

Playlist

Playlist base.

PlaylistTrack

Track or episode on a playlist.

PlaylistTrackPaging

Paging of playlist tracks.

SimplePlaylist

Simplified playlist object.

SimplePlaylistPaging

Paging of simplified playlists.

FullPlaylist

Complete playlist object.

FullPlaylistTrack

Track on a playlist.

FullPlaylistEpisode

Episode on a playlist.

LocalPlaylistTrack

Local track on a playlist.

LocalItem

Base for local items.

LocalAlbum

Album of a locally saved track.

LocalArtist

Artist of a locally saved track.

LocalTrack

Locally saved track.

class tekore.model.Playlist(*, id, href, type, uri, collaborative, description, external_urls, images, name, owner, public, snapshot_id, primary_color)

Bases: tekore.model.Item

Playlist base.

owner can be None on featured playlists.

Parameters
  • id (str) –

  • href (str) –

  • type (str) –

  • uri (str) –

  • collaborative (bool) –

  • description (Optional[str]) –

  • external_urls (dict) –

  • images (Optional[List[Image]]) –

  • name (str) –

  • owner (PublicUser) –

  • public (Optional[bool]) –

  • snapshot_id (str) –

  • primary_color (Optional[str]) –

Return type

None

class tekore.model.PlaylistTrack(*, added_at, added_by, is_local, track, primary_color, video_thumbnail)

Bases: tekore.model.Model

Track or episode on a playlist.

Parameters
Return type

None

class tekore.model.PlaylistTrackPaging(*, href, items, limit, next, total, offset, previous)

Bases: tekore.model.OffsetPaging

Paging of playlist tracks.

Parameters
  • href (str) –

  • items (List[PlaylistTrack]) –

  • limit (int) –

  • next (Optional[str]) –

  • total (int) –

  • offset (int) –

  • previous (Optional[str]) –

Return type

None

class tekore.model.SimplePlaylist(*, id, href, type, uri, collaborative, description, external_urls, images, name, owner, public, snapshot_id, primary_color, tracks)

Bases: tekore.model.Playlist

Simplified playlist object.

Parameters
  • id (str) –

  • href (str) –

  • type (str) –

  • uri (str) –

  • collaborative (bool) –

  • description (Optional[str]) –

  • external_urls (dict) –

  • images (Optional[List[Image]]) –

  • name (str) –

  • owner (PublicUser) –

  • public (Optional[bool]) –

  • snapshot_id (str) –

  • primary_color (Optional[str]) –

  • tracks (Tracks) –

Return type

None

class tekore.model.SimplePlaylistPaging(*, href, items, limit, next, total, offset, previous)

Bases: tekore.model.OffsetPaging

Paging of simplified playlists.

Parameters
  • href (str) –

  • items (List[Optional[SimplePlaylist]]) –

  • limit (int) –

  • next (Optional[str]) –

  • total (int) –

  • offset (int) –

  • previous (Optional[str]) –

Return type

None

class tekore.model.FullPlaylist(*, id, href, type, uri, collaborative, description, external_urls, images, name, owner, public, snapshot_id, primary_color, followers, tracks)

Bases: tekore.model.Playlist

Complete playlist object.

Parameters
  • id (str) –

  • href (str) –

  • type (str) –

  • uri (str) –

  • collaborative (bool) –

  • description (Optional[str]) –

  • external_urls (dict) –

  • images (Optional[List[Image]]) –

  • name (str) –

  • owner (PublicUser) –

  • public (Optional[bool]) –

  • snapshot_id (str) –

  • primary_color (Optional[str]) –

  • followers (Followers) –

  • tracks (PlaylistTrackPaging) –

Return type

None

class tekore.model.FullPlaylistTrack(*, id, href, type, uri, artists, available_markets=None, disc_number, duration_ms, explicit, external_urls, is_local, is_playable=None, linked_from=None, name, preview_url, restrictions=None, track_number, album, external_ids, popularity, episode, track)

Bases: tekore.model.FullTrack

Track on a playlist.

Provides episode and track booleans to easily determine the type of playlist item.

Parameters
  • id (str) –

  • href (str) –

  • type (str) –

  • uri (str) –

  • artists (List[SimpleArtist]) –

  • available_markets (Optional[List[str]]) –

  • disc_number (int) –

  • duration_ms (int) –

  • explicit (bool) –

  • external_urls (dict) –

  • is_local (Literal[False]) –

  • is_playable (Optional[bool]) –

  • linked_from (Optional[TrackLink]) –

  • name (str) –

  • preview_url (Optional[str]) –

  • restrictions (Optional[Restrictions]) –

  • track_number (int) –

  • album (SimpleAlbum) –

  • external_ids (dict) –

  • popularity (int) –

  • episode (Literal[False]) –

  • track (Literal[True]) –

Return type

None

class tekore.model.FullPlaylistEpisode(*, id, href, type, uri, audio_preview_url, description, duration_ms, explicit, external_urls, html_description, images, is_externally_hosted, is_playable=None, language=None, languages, name, release_date, release_date_precision, resume_point=None, restrictions=None, show, available_markets=None, episode, track)

Bases: tekore.model.FullEpisode

Episode on a playlist.

Provides episode and track booleans to easily determine the type of playlist item. available_markets is undocumented.

Parameters
  • id (str) –

  • href (str) –

  • type (str) –

  • uri (str) –

  • audio_preview_url (Optional[str]) –

  • description (str) –

  • duration_ms (int) –

  • explicit (bool) –

  • external_urls (dict) –

  • html_description (str) –

  • images (List[Image]) –

  • is_externally_hosted (bool) –

  • is_playable (Optional[bool]) –

  • language (Optional[str]) –

  • languages (List[str]) –

  • name (str) –

  • release_date (str) –

  • release_date_precision (ReleaseDatePrecision) –

  • resume_point (Optional[ResumePoint]) –

  • restrictions (Optional[Restrictions]) –

  • show (SimpleShow) –

  • available_markets (Optional[List[str]]) –

  • episode (Literal[True]) –

  • track (Literal[False]) –

Return type

None

Local items

Some playlists contain locally stored tracks. They contain mostly None values along with empty lists and dictionaries.

class tekore.model.LocalPlaylistTrack(*, id, href, name, type, uri, album, artists, available_markets, disc_number, duration_ms, explicit, external_ids, external_urls, is_local, popularity, preview_url, track_number, episode=False, track=True)

Bases: tekore.model.LocalTrack

Local track on a playlist.

Provides episode and track booleans to easily determine the type of playlist item.

Parameters
  • id (None) –

  • href (None) –

  • name (str) –

  • type (str) –

  • uri (str) –

  • album (LocalAlbum) –

  • artists (List[LocalArtist]) –

  • available_markets (List[None]) –

  • disc_number (int) –

  • duration_ms (Union[int, dict]) –

  • explicit (bool) –

  • external_ids (dict) –

  • external_urls (dict) –

  • is_local (Literal[True]) –

  • popularity (int) –

  • preview_url (None) –

  • track_number (int) –

  • episode (Literal[False]) –

  • track (Literal[True]) –

Return type

None

class tekore.model.LocalItem(*, id, href, name, type, uri)

Bases: tekore.model.Model

Base for local items.

Parameters
  • id (None) –

  • href (None) –

  • name (str) –

  • type (str) –

  • uri (None) –

Return type

None

class tekore.model.LocalAlbum(*, id, href, name, type, uri, album_type, artists, available_markets, external_urls, images, release_date, release_date_precision)

Bases: tekore.model.LocalItem

Album of a locally saved track.

Parameters
  • id (None) –

  • href (None) –

  • name (str) –

  • type (str) –

  • uri (None) –

  • album_type (None) –

  • artists (List[None]) –

  • available_markets (List[None]) –

  • external_urls (dict) –

  • images (List[None]) –

  • release_date (None) –

  • release_date_precision (None) –

Return type

None

class tekore.model.LocalArtist(*, id, href, name, type, uri, external_urls)

Bases: tekore.model.LocalItem

Artist of a locally saved track.

Parameters
  • id (None) –

  • href (None) –

  • name (str) –

  • type (str) –

  • uri (None) –

  • external_urls (dict) –

Return type

None

class tekore.model.LocalTrack(*, id, href, name, type, uri, album, artists, available_markets, disc_number, duration_ms, explicit, external_ids, external_urls, is_local, popularity, preview_url, track_number)

Bases: tekore.model.LocalItem

Locally saved track.

Locally saved track where most attributes are always None, empty, zero or False. duration_ms being an object is undocumented.

Parameters
  • id (None) –

  • href (None) –

  • name (str) –

  • type (str) –

  • uri (str) –

  • album (LocalAlbum) –

  • artists (List[LocalArtist]) –

  • available_markets (List[None]) –

  • disc_number (int) –

  • duration_ms (Union[int, dict]) –

  • explicit (bool) –

  • external_ids (dict) –

  • external_urls (dict) –

  • is_local (Literal[True]) –

  • popularity (int) –

  • preview_url (None) –

  • track_number (int) –

Return type

None

Recommendation

Recommendations

Track recommendations.

RecommendationSeed

Recommendation seeds.

RecommendationAttribute

Attributes available in recommendations.

class tekore.model.Recommendations(*, seeds, tracks)

Bases: tekore.model.Model

Track recommendations.

Parameters
Return type

None

class tekore.model.RecommendationSeed(*, id, afterFilteringSize, afterRelinkingSize, href, initialPoolSize, type)

Bases: tekore.model.Identifiable

Recommendation seeds.

Parameters
  • id (str) –

  • afterFilteringSize (int) –

  • afterRelinkingSize (int) –

  • href (Optional[str]) –

  • initialPoolSize (int) –

  • type (str) –

Return type

None

class tekore.model.RecommendationAttribute(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: tekore.model.StrEnum

Attributes available in recommendations.

acousticness = 'acousticness'
danceability = 'danceability'
duration_ms = 'duration_ms'
energy = 'energy'
instrumentalness = 'instrumentalness'
key = 'key'
liveness = 'liveness'
loudness = 'loudness'
mode = 'mode'
popularity = 'popularity'
speechiness = 'speechiness'
tempo = 'tempo'
time_signature = 'time_signature'
valence = 'valence'

Show

Show

Show base.

SimpleShow

Simplified show object.

SimpleShowPaging

Paging of simplified shows.

FullShow

Complete show object.

SavedShow

Show saved in library.

SavedShowPaging

Paging of shows in library.

class tekore.model.Show(*, id, href, type, uri, available_markets, copyrights, description, explicit, external_urls, html_description=None, images, is_externally_hosted, languages, media_type, name, publisher, total_episodes=None)

Bases: tekore.model.Item

Show base.

publisher being an object is undocumented.

Parameters
  • id (str) –

  • href (str) –

  • type (str) –

  • uri (str) –

  • available_markets (List[str]) –

  • copyrights (List[Copyright]) –

  • description (str) –

  • explicit (bool) –

  • external_urls (dict) –

  • html_description (Optional[str]) –

  • images (List[Image]) –

  • is_externally_hosted (Optional[bool]) –

  • languages (List[str]) –

  • media_type (str) –

  • name (str) –

  • publisher (Union[str, dict]) –

  • total_episodes (Optional[int]) –

Return type

None

class tekore.model.SimpleShow(*, id, href, type, uri, available_markets, copyrights, description, explicit, external_urls, html_description=None, images, is_externally_hosted, languages, media_type, name, publisher, total_episodes=None)

Bases: tekore.model.Show

Simplified show object.

total_episodes is undocumented by Spotify, so it might be missing or removed in a future version.

Parameters
  • id (str) –

  • href (str) –

  • type (str) –

  • uri (str) –

  • available_markets (List[str]) –

  • copyrights (List[Copyright]) –

  • description (str) –

  • explicit (bool) –

  • external_urls (dict) –

  • html_description (Optional[str]) –

  • images (List[Image]) –

  • is_externally_hosted (Optional[bool]) –

  • languages (List[str]) –

  • media_type (str) –

  • name (str) –

  • publisher (Union[str, dict]) –

  • total_episodes (Optional[int]) –

Return type

None

class tekore.model.SimpleShowPaging(*, href, items, limit, next, total, offset, previous)

Bases: tekore.model.OffsetPaging

Paging of simplified shows.

Parameters
  • href (str) –

  • items (List[SimpleShow]) –

  • limit (int) –

  • next (Optional[str]) –

  • total (int) –

  • offset (int) –

  • previous (Optional[str]) –

Return type

None

class tekore.model.FullShow(*, id, href, type, uri, available_markets, copyrights, description, explicit, external_urls, html_description=None, images, is_externally_hosted, languages, media_type, name, publisher, total_episodes=None, episodes=None)

Bases: tekore.model.Show

Complete show object.

total_episodes is undocumented by Spotify, so it might be missing or removed in a future version.

Parameters
  • id (str) –

  • href (str) –

  • type (str) –

  • uri (str) –

  • available_markets (List[str]) –

  • copyrights (List[Copyright]) –

  • description (str) –

  • explicit (bool) –

  • external_urls (dict) –

  • html_description (Optional[str]) –

  • images (List[Image]) –

  • is_externally_hosted (Optional[bool]) –

  • languages (List[str]) –

  • media_type (str) –

  • name (str) –

  • publisher (Union[str, dict]) –

  • total_episodes (Optional[int]) –

  • episodes (Optional[SimpleEpisodePaging]) –

Return type

None

class tekore.model.SavedShow(*, added_at, show)

Bases: tekore.model.Model

Show saved in library.

Parameters
  • added_at (datetime.datetime) –

  • show (SimpleShow) –

Return type

None

class tekore.model.SavedShowPaging(*, href, items, limit, next, total, offset, previous)

Bases: tekore.model.OffsetPaging

Paging of shows in library.

Parameters
  • href (str) –

  • items (List[SavedShow]) –

  • limit (int) –

  • next (Optional[str]) –

  • total (int) –

  • offset (int) –

  • previous (Optional[str]) –

Return type

None

Track

Track

Track base.

SimpleTrack

Simplified track object.

SimpleTrackPaging

Paging of simplified tracks.

FullTrack

Complete track object.

FullTrackPaging

Paging of full tracks.

SavedTrack

Track saved to library.

SavedTrackPaging

Paging of tracks in library.

Tracks

Minimal representation of playlist tracks.

TrackLink

Relinked track.

Restrictions

Restrictions on relinked resource.

AudioAnalysis

Track audio analysis.

TimeInterval

Generic representation of an interval.

Section

Analysis of a track's section.

Segment

Analysis of a track's segment.

AudioFeatures

Features of a track.

class tekore.model.Track(*, id, href, type, uri, artists, available_markets=None, disc_number, duration_ms, explicit, external_urls, is_local, is_playable=None, linked_from=None, name, preview_url, restrictions=None, track_number)

Bases: tekore.model.Item

Track base.

Parameters
  • id (str) –

  • href (str) –

  • type (str) –

  • uri (str) –

  • artists (List[SimpleArtist]) –

  • available_markets (Optional[List[str]]) –

  • disc_number (int) –

  • duration_ms (int) –

  • explicit (bool) –

  • external_urls (dict) –

  • is_local (bool) –

  • is_playable (Optional[bool]) –

  • linked_from (Optional[TrackLink]) –

  • name (str) –

  • preview_url (Optional[str]) –

  • restrictions (Optional[Restrictions]) –

  • track_number (int) –

Return type

None

class tekore.model.SimpleTrack(*, id, href, type, uri, artists, available_markets=None, disc_number, duration_ms, explicit, external_urls, is_local, is_playable=None, linked_from=None, name, preview_url, restrictions=None, track_number)

Bases: tekore.model.Track

Simplified track object.

When market is specified, available_markets is not available. is_playable is not available when market is not specified. restrictions is available if restrictions have been placed on the track, making it unplayable.

Parameters
  • id (str) –

  • href (str) –

  • type (str) –

  • uri (str) –

  • artists (List[SimpleArtist]) –

  • available_markets (Optional[List[str]]) –

  • disc_number (int) –

  • duration_ms (int) –

  • explicit (bool) –

  • external_urls (dict) –

  • is_local (bool) –

  • is_playable (Optional[bool]) –

  • linked_from (Optional[TrackLink]) –

  • name (str) –

  • preview_url (Optional[str]) –

  • restrictions (Optional[Restrictions]) –

  • track_number (int) –

Return type

None

class tekore.model.SimpleTrackPaging(*, href, items, limit, next, total, offset, previous)

Bases: tekore.model.OffsetPaging

Paging of simplified tracks.

Parameters
  • href (str) –

  • items (List[SimpleTrack]) –

  • limit (int) –

  • next (Optional[str]) –

  • total (int) –

  • offset (int) –

  • previous (Optional[str]) –

Return type

None

class tekore.model.FullTrack(*, id, href, type, uri, artists, available_markets=None, disc_number, duration_ms, explicit, external_urls, is_local, is_playable=None, linked_from=None, name, preview_url, restrictions=None, track_number, album, external_ids, popularity)

Bases: tekore.model.Track

Complete track object.

When market is specified, available_markets is not available. is_playable is not available when market is not specified. restrictions is available if restrictions have been placed on the track, making it unplayable.

Parameters
  • id (str) –

  • href (str) –

  • type (str) –

  • uri (str) –

  • artists (List[SimpleArtist]) –

  • available_markets (Optional[List[str]]) –

  • disc_number (int) –

  • duration_ms (int) –

  • explicit (bool) –

  • external_urls (dict) –

  • is_local (bool) –

  • is_playable (Optional[bool]) –

  • linked_from (Optional[TrackLink]) –

  • name (str) –

  • preview_url (Optional[str]) –

  • restrictions (Optional[Restrictions]) –

  • track_number (int) –

  • album (SimpleAlbum) –

  • external_ids (dict) –

  • popularity (int) –

Return type

None

class tekore.model.FullTrackPaging(*, href, items, limit, next, total, offset, previous)

Bases: tekore.model.OffsetPaging

Paging of full tracks.

Parameters
  • href (str) –

  • items (List[FullTrack]) –

  • limit (int) –

  • next (Optional[str]) –

  • total (int) –

  • offset (int) –

  • previous (Optional[str]) –

Return type

None

class tekore.model.SavedTrack(*, added_at, track)

Bases: tekore.model.Model

Track saved to library.

Parameters
  • added_at (datetime.datetime) –

  • track (FullTrack) –

Return type

None

class tekore.model.SavedTrackPaging(*, href, items, limit, next, total, offset, previous)

Bases: tekore.model.OffsetPaging

Paging of tracks in library.

Parameters
  • href (str) –

  • items (List[SavedTrack]) –

  • limit (int) –

  • next (Optional[str]) –

  • total (int) –

  • offset (int) –

  • previous (Optional[str]) –

Return type

None

class tekore.model.Tracks(*, href, total)

Bases: tekore.model.Model

Minimal representation of playlist tracks.

Parameters
  • href (str) –

  • total (int) –

Return type

None

Bases: tekore.model.Item

Relinked track.

Parameters
  • id (str) –

  • href (str) –

  • type (str) –

  • uri (str) –

  • external_urls (dict) –

Return type

None

class tekore.model.Restrictions(*, reason)

Bases: tekore.model.Model

Restrictions on relinked resource.

Parameters

reason (str) –

Return type

None

Audio analysis

class tekore.model.AudioAnalysis(*, bars, beats, sections, segments, tatums, meta, track)

Bases: tekore.model.Model

Track audio analysis.

See the Web API documentation for more details.

Parameters
Return type

None

class tekore.model.TimeInterval(*, duration, start=None, confidence=None)

Bases: tekore.model.Model

Generic representation of an interval.

Attributes are sometimes not available.

Parameters
  • duration (float) –

  • start (Optional[float]) –

  • confidence (Optional[float]) –

Return type

None

class tekore.model.Section(*, duration, loudness, tempo, tempo_confidence, key_confidence, mode_confidence, time_signature, time_signature_confidence, confidence=None, mode=None, key=None, start=None)

Bases: tekore.model.Model

Analysis of a track’s section.

Attributes are sometimes not available.

Parameters
  • duration (float) –

  • loudness (float) –

  • tempo (float) –

  • tempo_confidence (float) –

  • key_confidence (float) –

  • mode_confidence (float) –

  • time_signature (int) –

  • time_signature_confidence (float) –

  • confidence (Optional[float]) –

  • mode (Optional[int]) –

  • key (Optional[int]) –

  • start (Optional[float]) –

Return type

None

class tekore.model.Segment(*, duration, loudness_start, loudness_max, pitches, timbre, confidence=None, loudness_end=None, loudness_max_time=None, start=None)

Bases: tekore.model.Model

Analysis of a track’s segment.

Attributes are sometimes not available.

Parameters
  • duration (float) –

  • loudness_start (float) –

  • loudness_max (float) –

  • pitches (List[float]) –

  • timbre (List[float]) –

  • confidence (Optional[float]) –

  • loudness_end (Optional[float]) –

  • loudness_max_time (Optional[float]) –

  • start (Optional[float]) –

Return type

None

Audio features

class tekore.model.AudioFeatures(*, id, acousticness, analysis_url, danceability, duration_ms, energy, instrumentalness, key, liveness, loudness, mode, speechiness, tempo, time_signature, track_href, type, uri, valence)

Bases: tekore.model.Identifiable

Features of a track.

Parameters
  • id (str) –

  • acousticness (float) –

  • analysis_url (str) –

  • danceability (float) –

  • duration_ms (int) –

  • energy (float) –

  • instrumentalness (float) –

  • key (int) –

  • liveness (float) –

  • loudness (float) –

  • mode (int) –

  • speechiness (float) –

  • tempo (float) –

  • time_signature (int) –

  • track_href (str) –

  • type (str) –

  • uri (str) –

  • valence (float) –

Return type

None

User

User

User base.

PublicUser

User as viewable by anyone.

PrivateUser

User with private information.

ExplicitContent

Explicit content filter of a user.

class tekore.model.User(*, id, href, type, uri, external_urls, display_name=None, followers=None, images=None)

Bases: tekore.model.Item

User base.

display_name, followers and images may not be available.

Parameters
  • id (str) –

  • href (str) –

  • type (str) –

  • uri (str) –

  • external_urls (dict) –

  • display_name (Optional[str]) –

  • followers (Optional[Followers]) –

  • images (Optional[List[Image]]) –

Return type

None

class tekore.model.PublicUser(*, id, href, type, uri, external_urls, display_name=None, followers=None, images=None)

Bases: tekore.model.User

User as viewable by anyone.

Parameters
  • id (str) –

  • href (str) –

  • type (str) –

  • uri (str) –

  • external_urls (dict) –

  • display_name (Optional[str]) –

  • followers (Optional[Followers]) –

  • images (Optional[List[Image]]) –

Return type

None

class tekore.model.PrivateUser(*, id, href, type, uri, external_urls, display_name=None, followers=None, images=None, country=None, email=None, explicit_content=None, product=None, birthday=None)

Bases: tekore.model.User

User with private information.

country, explicit_content and product require the user-read-private scope. email requires the user-read-email scope. birthday is unavailable unless the now-invalid user-read-birthdate scope was granted to the token.

Parameters
  • id (str) –

  • href (str) –

  • type (str) –

  • uri (str) –

  • external_urls (dict) –

  • display_name (Optional[str]) –

  • followers (Optional[Followers]) –

  • images (Optional[List[Image]]) –

  • country (Optional[str]) –

  • email (Optional[str]) –

  • explicit_content (Optional[ExplicitContent]) –

  • product (Optional[str]) –

  • birthday (Optional[str]) –

Return type

None

class tekore.model.ExplicitContent(*, filter_enabled, filter_locked)

Bases: tekore.model.Model

Explicit content filter of a user.

Parameters
  • filter_enabled (bool) –

  • filter_locked (bool) –

Return type

None

Miscellaneous

Copyright

Copyright.

Followers

Followers.

Image

Image link and information.

ReleaseDatePrecision

Precision of a release date.

class tekore.model.Copyright(*, text, type)

Bases: tekore.model.Model

Copyright.

Parameters
  • text (str) –

  • type (str) –

Return type

None

class tekore.model.Followers(*, href, total)

Bases: tekore.model.Model

Followers.

href is always None.

Parameters
  • href (None) –

  • total (int) –

Return type

None

class tekore.model.Image(*, url, height, width)

Bases: tekore.model.Model

Image link and information.

The Web API documentation reports that height and width can be None or not available in the response.

Parameters
  • url (str) –

  • height (Optional[int]) –

  • width (Optional[int]) –

Return type

None

class tekore.model.ReleaseDatePrecision(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: tekore.model.StrEnum

Precision of a release date.

day = 'day'
minute = 'minute'
month = 'month'
year = 'year'

Model bases

Model

Response model base.

UnknownModelAttributeWarning

The response model contains an unknown attribute.

Identifiable

Object identified with a Spotify ID.

Item

Identifiable with additional fields.

Paging

Paging base.

OffsetPaging

Offset paging base.

Cursor

Data cursor.

CursorPaging

Cursor paging base.

Functionality

class tekore.model.Model

Bases: pydantic.main.BaseModel

Response model base.

Return type

None

class tekore.model.UnknownModelAttributeWarning

Bases: RuntimeWarning

The response model contains an unknown attribute.

Models

class tekore.model.Identifiable(*, id)

Bases: tekore.model.Model

Object identified with a Spotify ID.

Parameters

id (str) –

Return type

None

class tekore.model.Item(*, id, href, type, uri)

Bases: tekore.model.Identifiable

Identifiable with additional fields.

Parameters
  • id (str) –

  • href (str) –

  • type (str) –

  • uri (str) –

Return type

None

class tekore.model.Paging(*, href, items, limit, next)

Bases: tekore.model.Model

Paging base.

Parameters
  • href (str) –

  • items (Sequence[Model]) –

  • limit (int) –

  • next (Optional[str]) –

Return type

None

class tekore.model.OffsetPaging(*, href, items, limit, next, total, offset, previous)

Bases: tekore.model.Paging

Offset paging base.

Paging that can be navigated both forward and back.

Parameters
  • href (str) –

  • items (Sequence[Model]) –

  • limit (int) –

  • next (Optional[str]) –

  • total (int) –

  • offset (int) –

  • previous (Optional[str]) –

Return type

None

class tekore.model.Cursor(*, after)

Bases: tekore.model.Model

Data cursor.

Parameters

after (Optional[str]) –

Return type

None

class tekore.model.CursorPaging(*, href, items, limit, next, cursors)

Bases: tekore.model.Paging

Cursor paging base.

Paging that can be navigated only forward following the cursor.

Parameters
  • href (str) –

  • items (Sequence[Model]) –

  • limit (int) –

  • next (Optional[str]) –

  • cursors (Cursor) –

Return type

None

Member types

class tekore.model.StrEnum(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: str, enum.Enum

Convert enumeration members to strings using their name.

Ignores case when getting items. This does not change values.