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 base. |
|
Relationship between artist and album. |
|
Type of album. |
|
Simplified album object. |
|
Paging containing simplified albums. |
|
Complete album object. |
|
Album saved to library. |
|
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:
ItemAlbum 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 (list[str] | None)
is_playable (bool | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.AlbumGroup(value)
Bases:
StrEnumRelationship between artist and album.
- album = 'album'
- appears_on = 'appears_on'
- compilation = 'compilation'
- single = 'single'
- class tekore.model.AlbumType(value)
Bases:
StrEnumType of album.
- album = 'album'
- compilation = 'compilation'
- ep = 'ep'
- 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:
AlbumSimplified album object.
album_groupis available when getting an artist’s albums.available_marketsis available when market is not specified.The presence of
is_playableis undocumented and it appears to only beTruewhen 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 (list[str] | None)
is_playable (bool | None)
album_group (AlbumGroup | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.SimpleAlbumPaging(*, href, items, limit, next, total, offset, previous)
Bases:
OffsetPagingPaging containing simplified albums.
- Parameters:
href (str)
items (list[SimpleAlbum])
limit (int)
next (str | None)
total (int)
offset (int)
previous (str | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- 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:
AlbumComplete album object.
available_marketsis available when market is not specified.The presence of
is_playableis undocumented and it appears to only beTruewhen 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 (list[str] | None)
is_playable (bool | None)
copyrights (list[Copyright])
external_ids (dict)
genres (list[str])
label (str | None)
popularity (int)
tracks (SimpleTrackPaging)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.SavedAlbum(*, added_at, album)
Bases:
ModelAlbum saved to library.
- Parameters:
added_at (datetime)
album (FullAlbum)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.SavedAlbumPaging(*, href, items, limit, next, total, offset, previous)
Bases:
OffsetPagingPaging of albums in library.
- Parameters:
href (str)
items (list[SavedAlbum])
limit (int)
next (str | None)
total (int)
offset (int)
previous (str | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Artist
Artist base. |
|
Simplified artist object. |
|
Complete artist object. |
|
Paging of full artists. |
|
Paging of full artists. |
- class tekore.model.Artist(*, id, href, type, uri, external_urls, name)
Bases:
ItemArtist base.
- Parameters:
id (str)
href (str)
type (str)
uri (str)
external_urls (dict)
name (str)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.SimpleArtist(*, id, href, type, uri, external_urls, name)
Bases:
ArtistSimplified artist object.
- Parameters:
id (str)
href (str)
type (str)
uri (str)
external_urls (dict)
name (str)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.FullArtist(*, id, href, type, uri, external_urls, name, followers, genres, images, popularity)
Bases:
ArtistComplete artist object.
- Parameters:
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.FullArtistCursorPaging(*, href, items, limit, next, cursors, total)
Bases:
CursorPagingPaging of full artists.
- Parameters:
href (str)
items (list[FullArtist])
limit (int)
next (str | None)
cursors (Cursor)
total (int)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.FullArtistOffsetPaging(*, href, items, limit, next, total, offset, previous)
Bases:
OffsetPagingPaging of full artists.
- Parameters:
href (str)
items (list[FullArtist])
limit (int)
next (str | None)
total (int)
offset (int)
previous (str | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Audiobook
Audiobook base. |
|
Simplified audiobook. |
|
Paging of simplified audiobooks. |
|
Complete audiobook object. |
|
Audiobook author. |
|
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:
ItemAudiobook base.
- Parameters:
id (str)
href (str)
type (str)
uri (str)
authors (list[Author])
available_markets (list[str] | None)
copyrights (list[Copyright])
description (str)
edition (str | None)
explicit (bool)
external_urls (dict)
html_description (str)
images (list[Image])
is_externally_hosted (bool | None)
languages (list[str])
media_type (str)
name (str)
narrators (list[Narrator])
publisher (str)
total_chapters (int | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- 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:
AudiobookSimplified audiobook.
May contain
chapters, but that is likely an error.- Parameters:
id (str)
href (str)
type (str)
uri (str)
authors (list[Author])
available_markets (list[str] | None)
copyrights (list[Copyright])
description (str)
edition (str | None)
explicit (bool)
external_urls (dict)
html_description (str)
images (list[Image])
is_externally_hosted (bool | None)
languages (list[str])
media_type (str)
name (str)
narrators (list[Narrator])
publisher (str)
total_chapters (int | None)
chapters (dict | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.SimpleAudiobookPaging(*, href, items, limit, next, total, offset, previous)
Bases:
OffsetPagingPaging of simplified audiobooks.
- Parameters:
href (str)
items (list[SimpleAudiobook])
limit (int)
next (str | None)
total (int)
offset (int)
previous (str | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- 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, is_playable=None)
Bases:
AudiobookComplete audiobook object.
- Parameters:
id (str)
href (str)
type (str)
uri (str)
authors (list[Author])
available_markets (list[str] | None)
copyrights (list[Copyright])
description (str)
edition (str | None)
explicit (bool)
external_urls (dict)
html_description (str)
images (list[Image])
is_externally_hosted (bool | None)
languages (list[str])
media_type (str)
name (str)
narrators (list[Narrator])
publisher (str)
total_chapters (int | None)
chapters (SimpleChapterPaging)
is_playable (bool | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Category
Spotify tag category. |
|
Paging of categories. |
- class tekore.model.Category(*, id, href, icons, name)
Bases:
IdentifiableSpotify tag category.
- Parameters:
id (str)
href (str)
icons (list[Image])
name (str)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.CategoryPaging(*, href, items, limit, next, total, offset, previous)
Bases:
OffsetPagingPaging of categories.
- Parameters:
href (str)
items (list[Category])
limit (int)
next (str | None)
total (int)
offset (int)
previous (str | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Chapter
Audiobook chapter base. |
|
Simplified chapter. |
|
Paging of simplified chapters. |
|
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=None)
Bases:
ItemAudiobook chapter base.
- Parameters:
id (str)
href (str)
type (str)
uri (str)
audio_preview_url (str | None)
available_markets (list[str] | None)
chapter_number (int)
description (str)
duration_ms (int)
explicit (bool)
external_urls (dict)
html_description (str)
images (list[Image])
is_playable (bool | None)
languages (list[str])
name (str)
release_date_precision (ReleaseDatePrecision)
release_date (str)
restrictions (Restrictions | None)
resume_point (ResumePoint | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- 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=None)
Bases:
ChapterSimplified chapter.
- Parameters:
id (str)
href (str)
type (str)
uri (str)
audio_preview_url (str | None)
available_markets (list[str] | None)
chapter_number (int)
description (str)
duration_ms (int)
explicit (bool)
external_urls (dict)
html_description (str)
images (list[Image])
is_playable (bool | None)
languages (list[str])
name (str)
release_date_precision (ReleaseDatePrecision)
release_date (str)
restrictions (Restrictions | None)
resume_point (ResumePoint | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.SimpleChapterPaging(*, href, items, limit, next, total, offset, previous)
Bases:
OffsetPagingPaging of simplified chapters.
- Parameters:
href (str)
items (list[SimpleChapter])
limit (int)
next (str | None)
total (int)
offset (int)
previous (str | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- 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=None, audiobook)
Bases:
ChapterComplete chapter object.
- Parameters:
id (str)
href (str)
type (str)
uri (str)
audio_preview_url (str | None)
available_markets (list[str] | None)
chapter_number (int)
description (str)
duration_ms (int)
explicit (bool)
external_urls (dict)
html_description (str)
images (list[Image])
is_playable (bool | None)
languages (list[str])
name (str)
release_date_precision (ReleaseDatePrecision)
release_date (str)
restrictions (Restrictions | None)
resume_point (ResumePoint | None)
audiobook (SimpleAudiobook)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Episode
Episode base. |
|
Simplified episode object. |
|
Paging of simplified episodes. |
|
Complete episode object. |
|
Episode saved to library. |
|
Paging of episodes in library. |
|
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:
ItemEpisode base.
languageis deprecated.- Parameters:
id (str)
href (str)
type (str)
uri (str)
audio_preview_url (str | None)
description (str)
duration_ms (int)
explicit (bool)
external_urls (dict)
html_description (str)
images (list[Image])
is_externally_hosted (bool)
is_playable (bool | None)
language (str | None)
languages (list[str])
name (str)
release_date (str)
release_date_precision (ReleaseDatePrecision)
resume_point (ResumePoint | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- 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:
EpisodeSimplified episode object.
- Parameters:
id (str)
href (str)
type (str)
uri (str)
audio_preview_url (str | None)
description (str)
duration_ms (int)
explicit (bool)
external_urls (dict)
html_description (str)
images (list[Image])
is_externally_hosted (bool)
is_playable (bool | None)
language (str | None)
languages (list[str])
name (str)
release_date (str)
release_date_precision (ReleaseDatePrecision)
resume_point (ResumePoint | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.SimpleEpisodePaging(*, href, items, limit, next, total, offset, previous)
Bases:
OffsetPagingPaging of simplified episodes.
- Parameters:
href (str)
items (list[SimpleEpisode])
limit (int)
next (str | None)
total (int)
offset (int)
previous (str | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- 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:
EpisodeComplete episode object.
- Parameters:
id (str)
href (str)
type (str)
uri (str)
audio_preview_url (str | None)
description (str)
duration_ms (int)
explicit (bool)
external_urls (dict)
html_description (str)
images (list[Image])
is_externally_hosted (bool)
is_playable (bool | None)
language (str | None)
languages (list[str])
name (str)
release_date (str)
release_date_precision (ReleaseDatePrecision)
resume_point (ResumePoint | None)
restrictions (Restrictions | None)
show (SimpleShow)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.SavedEpisode(*, added_at, episode)
Bases:
ModelEpisode saved to library.
- Parameters:
added_at (datetime)
episode (FullEpisode)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.SavedEpisodePaging(*, href, items, limit, next, total, offset, previous)
Bases:
OffsetPagingPaging of episodes in library.
- Parameters:
href (str)
items (list[SavedEpisode])
limit (int)
next (str | None)
total (int)
offset (int)
previous (str | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.ResumePoint(*, fully_played, resume_position_ms)
Bases:
ModelResume point.
- Parameters:
fully_played (bool)
resume_position_ms (int)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Playback
Current playback. |
|
Extended current playback context. |
|
Type of currently playing item. |
|
Playback queue. |
|
Playback device. |
|
Type of playback device. |
|
Player actions. |
|
Disallowed player actions. |
|
Reasons for errors in player actions. |
|
Playback repeat state. |
|
Previously played track. |
|
Cursor to play history. |
|
Paging to play history. |
|
Context of a played track or episode. |
|
Type of player context. |
Currently playing
- class tekore.model.CurrentlyPlaying(*, actions, currently_playing_type, is_playing, timestamp, context, progress_ms, item)
Bases:
ModelCurrent playback.
context,progress_msanditemmay beNonee.g. during a private session.- Parameters:
actions (Actions)
currently_playing_type (CurrentlyPlayingType)
is_playing (bool)
timestamp (int)
context (Context | None)
progress_ms (int | None)
item (FullTrack | LocalTrack | FullEpisode | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.CurrentlyPlayingContext(*, actions, currently_playing_type, is_playing, timestamp, context, progress_ms, item, device, repeat_state, shuffle_state, smart_shuffle)
Bases:
CurrentlyPlayingExtended current playback context.
smart_shuffleis not documented in the Spotify API.- Parameters:
actions (Actions)
currently_playing_type (CurrentlyPlayingType)
is_playing (bool)
timestamp (int)
context (Context | None)
progress_ms (int | None)
item (FullTrack | LocalTrack | FullEpisode | None)
device (Device)
repeat_state (RepeatState)
shuffle_state (bool)
smart_shuffle (bool | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.CurrentlyPlayingType(value)
Bases:
StrEnumType of currently playing item.
- ad = 'ad'
- episode = 'episode'
- track = 'track'
- unknown = 'unknown'
- class tekore.model.Queue(*, currently_playing, queue)
Bases:
ModelPlayback queue.
- Parameters:
currently_playing (FullTrack | LocalTrack | FullEpisode | None)
queue (list[FullTrack | LocalTrack | FullEpisode | None])
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.Device(*, id, is_active, is_private_session, is_restricted, name, type, volume_percent, supports_volume)
Bases:
IdentifiablePlayback device.
- Parameters:
id (str)
is_active (bool)
is_private_session (bool)
is_restricted (bool)
name (str)
type (DeviceType)
volume_percent (int | None)
supports_volume (bool)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.DeviceType(value)
Bases:
StrEnumType 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'
- class tekore.model.Actions(*, disallows)
Bases:
ModelPlayer actions.
- Parameters:
disallows (Disallows)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- 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:
ModelDisallowed 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)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.PlayerErrorReason(value)
Bases:
EnumReasons 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."
Play history
- class tekore.model.PlayHistory(*, track, played_at, context)
Bases:
ModelPreviously played track.
Context is supposedly sometimes available.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.PlayHistoryCursor(*, after, before)
Bases:
CursorCursor to play history.
- Parameters:
after (str | None)
before (str)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.PlayHistoryPaging(*, href, items, limit, next, cursors)
Bases:
CursorPagingPaging to play history.
Cursors are not available when paging is exhausted.
- Parameters:
href (str)
items (list[PlayHistory])
limit (int)
next (str | None)
cursors (PlayHistoryCursor | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.Context(*, type, href, external_urls, uri)
Bases:
ModelContext of a played track or episode.
- Parameters:
type (ContextType)
href (str)
external_urls (dict)
uri (str)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Playlist
Playlist base. |
|
Track or episode on a playlist. |
|
Paging of playlist tracks. |
|
Simplified playlist object. |
|
Paging of simplified playlists. |
|
Complete playlist object. |
|
Track on a playlist. |
|
Episode on a playlist. |
|
Local track on a playlist. |
|
Base for local items. |
|
Album of a locally saved track. |
|
Artist of a locally saved track. |
|
Locally saved track. |
- class tekore.model.Playlist(*, id, href, type, uri, collaborative, description, external_urls, images, name, owner, public, snapshot_id, primary_color)
Bases:
ItemPlaylist base.
ownercan beNoneon featured playlists.- Parameters:
id (str)
href (str)
type (str)
uri (str)
collaborative (bool)
description (str | None)
external_urls (dict)
images (list[Image] | None)
name (str)
owner (PublicUser)
public (bool | None)
snapshot_id (str)
primary_color (str | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.PlaylistTrack(*, added_at, added_by, is_local, track=None, item=None, primary_color, video_thumbnail)
Bases:
ModelTrack or episode on a playlist.
track and item are the same, but track is deprecated and may be removed in a future version.
- Parameters:
added_at (datetime)
added_by (PublicUser)
is_local (bool)
track (FullPlaylistTrack | FullPlaylistEpisode | LocalPlaylistTrack | None)
item (FullPlaylistTrack | FullPlaylistEpisode | LocalPlaylistTrack | None)
primary_color (str | None)
video_thumbnail (dict | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.PlaylistTrackPaging(*, href, items, limit, next, total, offset, previous)
Bases:
OffsetPagingPaging of playlist tracks.
- Parameters:
href (str)
items (list[PlaylistTrack])
limit (int)
next (str | None)
total (int)
offset (int)
previous (str | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.SimplePlaylist(*, id, href, type, uri, collaborative, description, external_urls, images, name, owner, public, snapshot_id, primary_color, tracks, items)
Bases:
PlaylistSimplified playlist object.
tracks and items are the same, but tracks is deprecated and may be removed in a future version.
- Parameters:
id (str)
href (str)
type (str)
uri (str)
collaborative (bool)
description (str | None)
external_urls (dict)
images (list[Image] | None)
name (str)
owner (PublicUser)
public (bool | None)
snapshot_id (str)
primary_color (str | None)
tracks (Tracks)
items (Tracks)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.SimplePlaylistPaging(*, href, items, limit, next, total, offset, previous)
Bases:
OffsetPagingPaging of simplified playlists.
- Parameters:
href (str)
items (list[SimplePlaylist | None])
limit (int)
next (str | None)
total (int)
offset (int)
previous (str | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.FullPlaylist(*, id, href, type, uri, collaborative, description, external_urls, images, name, owner, public, snapshot_id, primary_color, followers, tracks, items)
Bases:
PlaylistComplete playlist object.
tracks and items are the same, but tracks is deprecated and may be removed in a future version.
- Parameters:
id (str)
href (str)
type (str)
uri (str)
collaborative (bool)
description (str | None)
external_urls (dict)
images (list[Image] | None)
name (str)
owner (PublicUser)
public (bool | None)
snapshot_id (str)
primary_color (str | None)
followers (Followers)
tracks (PlaylistTrackPaging)
items (PlaylistTrackPaging)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- 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=None, restrictions=None, track_number, album, external_ids, popularity, episode, track)
Bases:
FullTrackTrack on a playlist.
Provides
episodeandtrackbooleans to easily determine the type of playlist item.- Parameters:
id (str)
href (str)
type (str)
uri (str)
artists (list[SimpleArtist])
available_markets (list[str] | None)
disc_number (int)
duration_ms (int)
explicit (bool)
external_urls (dict)
is_local (Literal[False])
is_playable (bool | None)
linked_from (TrackLink | None)
name (str)
preview_url (str | None)
restrictions (Restrictions | None)
track_number (int)
album (SimpleAlbum)
external_ids (dict)
popularity (int)
episode (Literal[False])
track (Literal[True])
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- 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:
FullEpisodeEpisode on a playlist.
Provides
episodeandtrackbooleans to easily determine the type of playlist item.available_marketsis undocumented.- Parameters:
id (str)
href (str)
type (str)
uri (str)
audio_preview_url (str | None)
description (str)
duration_ms (int)
explicit (bool)
external_urls (dict)
html_description (str)
images (list[Image])
is_externally_hosted (bool)
is_playable (bool | None)
language (str | None)
languages (list[str])
name (str)
release_date (str)
release_date_precision (ReleaseDatePrecision)
resume_point (ResumePoint | None)
restrictions (Restrictions | None)
show (SimpleShow)
available_markets (list[str] | None)
episode (Literal[True])
track (Literal[False])
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
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, album, artists, available_markets=<factory>, disc_number, duration_ms, explicit, external_ids, external_urls, is_local, popularity, preview_url, track_number, uri, episode=False, track=True)
Bases:
LocalTrackLocal track on a playlist.
Provides
episodeandtrackbooleans to easily determine the type of playlist item.- Parameters:
id (None)
href (None)
name (str)
type (str)
album (LocalAlbum)
artists (list[LocalArtist])
available_markets (list[None])
disc_number (int)
duration_ms (int | dict)
explicit (bool)
external_ids (dict)
external_urls (dict)
is_local (Literal[True])
popularity (int)
preview_url (None)
track_number (int)
uri (str)
episode (Literal[False])
track (Literal[True])
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.LocalItem(*, id, href, name, type)
Bases:
ModelBase for local items.
- Parameters:
id (None)
href (None)
name (str)
type (str)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.LocalAlbum(*, id, href, name, type, album_type, artists, available_markets=<factory>, external_urls, images, release_date, release_date_precision, uri)
Bases:
LocalItemAlbum of a locally saved track.
- Parameters:
id (None)
href (None)
name (str)
type (str)
album_type (None)
artists (list[None])
available_markets (list[None])
external_urls (dict)
images (list[None])
release_date (None)
release_date_precision (None)
uri (None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.LocalArtist(*, id, href, name, type, external_urls, uri)
Bases:
LocalItemArtist of a locally saved track.
- Parameters:
id (None)
href (None)
name (str)
type (str)
external_urls (dict)
uri (None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.LocalTrack(*, id, href, name, type, album, artists, available_markets=<factory>, disc_number, duration_ms, explicit, external_ids, external_urls, is_local, popularity, preview_url, track_number, uri)
Bases:
LocalItemLocally saved track.
Locally saved track where most attributes are always None, empty, zero or False.
duration_msbeing an object is undocumented.- Parameters:
id (None)
href (None)
name (str)
type (str)
album (LocalAlbum)
artists (list[LocalArtist])
available_markets (list[None])
disc_number (int)
duration_ms (int | dict)
explicit (bool)
external_ids (dict)
external_urls (dict)
is_local (Literal[True])
popularity (int)
preview_url (None)
track_number (int)
uri (str)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Recommendation
Track recommendations. |
|
Recommendation seeds. |
|
Attributes available in recommendations. |
- class tekore.model.Recommendations(*, seeds, tracks)
Bases:
ModelTrack recommendations.
- Parameters:
seeds (list[RecommendationSeed])
tracks (list[FullTrack])
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.RecommendationSeed(*, id, afterFilteringSize, afterRelinkingSize, href, initialPoolSize, type)
Bases:
IdentifiableRecommendation seeds.
- Parameters:
id (str)
afterFilteringSize (int)
afterRelinkingSize (int)
href (str | None)
initialPoolSize (int)
type (str)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.RecommendationAttribute(value)
Bases:
StrEnumAttributes 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 base. |
|
Simplified show object. |
|
Paging of simplified shows. |
|
Complete show object. |
|
Show saved in library. |
|
Paging of shows in library. |
- class tekore.model.Show(*, id, href, type, uri, available_markets=<factory>, copyrights, description, explicit, external_urls, html_description=None, images, is_externally_hosted, languages, media_type, name, publisher, total_episodes=None)
Bases:
ItemShow base.
publisherbeing 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 (str | None)
images (list[Image])
is_externally_hosted (bool | None)
languages (list[str])
media_type (str)
name (str)
publisher (str | dict)
total_episodes (int | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.SimpleShow(*, id, href, type, uri, available_markets=<factory>, copyrights, description, explicit, external_urls, html_description=None, images, is_externally_hosted, languages, media_type, name, publisher, total_episodes=None)
Bases:
ShowSimplified show object.
total_episodesis 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 (str | None)
images (list[Image])
is_externally_hosted (bool | None)
languages (list[str])
media_type (str)
name (str)
publisher (str | dict)
total_episodes (int | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.SimpleShowPaging(*, href, items, limit, next, total, offset, previous)
Bases:
OffsetPagingPaging of simplified shows.
- Parameters:
href (str)
items (list[SimpleShow])
limit (int)
next (str | None)
total (int)
offset (int)
previous (str | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.FullShow(*, id, href, type, uri, available_markets=<factory>, copyrights, description, explicit, external_urls, html_description=None, images, is_externally_hosted, languages, media_type, name, publisher, total_episodes=None, episodes=None)
Bases:
ShowComplete show object.
total_episodesis 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 (str | None)
images (list[Image])
is_externally_hosted (bool | None)
languages (list[str])
media_type (str)
name (str)
publisher (str | dict)
total_episodes (int | None)
episodes (SimpleEpisodePaging | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.SavedShow(*, added_at, show)
Bases:
ModelShow saved in library.
- Parameters:
added_at (datetime)
show (SimpleShow)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.SavedShowPaging(*, href, items, limit, next, total, offset, previous)
Bases:
OffsetPagingPaging of shows in library.
- Parameters:
href (str)
items (list[SavedShow])
limit (int)
next (str | None)
total (int)
offset (int)
previous (str | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Track
Track base. |
|
Simplified track object. |
|
Paging of simplified tracks. |
|
Complete track object. |
|
Paging of full tracks. |
|
Track saved to library. |
|
Paging of tracks in library. |
|
Minimal representation of playlist tracks. |
|
Relinked track. |
|
Restrictions on relinked resource. |
|
Track audio analysis. |
|
Generic representation of an interval. |
|
Analysis of a track's section. |
|
Analysis of a track's segment. |
|
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=None, restrictions=None, track_number)
Bases:
ItemTrack base.
- Parameters:
id (str)
href (str)
type (str)
uri (str)
artists (list[SimpleArtist])
available_markets (list[str] | None)
disc_number (int)
duration_ms (int)
explicit (bool)
external_urls (dict)
is_local (bool)
is_playable (bool | None)
linked_from (TrackLink | None)
name (str)
preview_url (str | None)
restrictions (Restrictions | None)
track_number (int)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- 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=None, restrictions=None, track_number)
Bases:
TrackSimplified track object.
When market is specified,
available_marketsis not available.is_playableis not available when market is not specified.restrictionsis 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 (list[str] | None)
disc_number (int)
duration_ms (int)
explicit (bool)
external_urls (dict)
is_local (bool)
is_playable (bool | None)
linked_from (TrackLink | None)
name (str)
preview_url (str | None)
restrictions (Restrictions | None)
track_number (int)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.SimpleTrackPaging(*, href, items, limit, next, total, offset, previous)
Bases:
OffsetPagingPaging of simplified tracks.
- Parameters:
href (str)
items (list[SimpleTrack])
limit (int)
next (str | None)
total (int)
offset (int)
previous (str | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- 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=None, restrictions=None, track_number, album, external_ids, popularity)
Bases:
TrackComplete track object.
When market is specified,
available_marketsis not available.is_playableis not available when market is not specified.restrictionsis 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 (list[str] | None)
disc_number (int)
duration_ms (int)
explicit (bool)
external_urls (dict)
is_local (bool)
is_playable (bool | None)
linked_from (TrackLink | None)
name (str)
preview_url (str | None)
restrictions (Restrictions | None)
track_number (int)
album (SimpleAlbum)
external_ids (dict)
popularity (int)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.FullTrackPaging(*, href, items, limit, next, total, offset, previous)
Bases:
OffsetPagingPaging of full tracks.
- Parameters:
href (str)
items (list[FullTrack])
limit (int)
next (str | None)
total (int)
offset (int)
previous (str | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.SavedTrack(*, added_at, track)
Bases:
ModelTrack saved to library.
- Parameters:
added_at (datetime)
track (FullTrack)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.SavedTrackPaging(*, href, items, limit, next, total, offset, previous)
Bases:
OffsetPagingPaging of tracks in library.
- Parameters:
href (str)
items (list[SavedTrack])
limit (int)
next (str | None)
total (int)
offset (int)
previous (str | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.Tracks(*, href, total)
Bases:
ModelMinimal representation of playlist tracks.
- Parameters:
href (str)
total (int)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.TrackLink(*, id, href, type, uri, external_urls)
Bases:
ItemRelinked track.
- Parameters:
id (str)
href (str)
type (str)
uri (str)
external_urls (dict)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.Restrictions(*, reason)
Bases:
ModelRestrictions on relinked resource.
- Parameters:
reason (str)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Audio analysis
- class tekore.model.AudioAnalysis(*, bars, beats, sections, segments, tatums, meta, track)
Bases:
ModelTrack audio analysis.
See the Web API documentation for more details.
- Parameters:
bars (list[TimeInterval])
beats (list[TimeInterval])
sections (list[Section])
segments (list[Segment])
tatums (list[TimeInterval])
meta (dict)
track (dict)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.TimeInterval(*, duration, start=None, confidence=None)
Bases:
ModelGeneric representation of an interval.
Attributes are sometimes not available.
- Parameters:
duration (float)
start (float | None)
confidence (float | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- 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:
ModelAnalysis 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 (float | None)
mode (int | None)
key (int | None)
start (float | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.Segment(*, duration, loudness_start, loudness_max, pitches, timbre, confidence=None, loudness_end=None, loudness_max_time=None, start=None)
Bases:
ModelAnalysis 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 (float | None)
loudness_end (float | None)
loudness_max_time (float | None)
start (float | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
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:
IdentifiableFeatures 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)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
User
User base. |
|
User as viewable by anyone. |
|
User with private information. |
|
Explicit content filter of a user. |
- class tekore.model.User(*, id, href, type, uri, external_urls, display_name=None, followers=None, images=None)
Bases:
ItemUser base.
display_name,followersandimagesmay not be available.- Parameters:
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.PublicUser(*, id, href, type, uri, external_urls, display_name=None, followers=None, images=None)
Bases:
UserUser as viewable by anyone.
- Parameters:
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- 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:
UserUser with private information.
country,explicit_contentandproductrequire theuser-read-privatescope.emailrequires theuser-read-emailscope.birthdayis unavailable unless the now-invaliduser-read-birthdatescope was granted to the token.- Parameters:
id (str)
href (str)
type (str)
uri (str)
external_urls (dict)
display_name (str | None)
followers (Followers | None)
images (list[Image] | None)
country (str | None)
email (str | None)
explicit_content (ExplicitContent | None)
product (str | None)
birthday (str | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.ExplicitContent(*, filter_enabled, filter_locked)
Bases:
ModelExplicit content filter of a user.
- Parameters:
filter_enabled (bool)
filter_locked (bool)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Miscellaneous
Copyright. |
|
Followers. |
|
Image link and information. |
|
Precision of a release date. |
- class tekore.model.Copyright(*, text, type)
Bases:
ModelCopyright.
- Parameters:
text (str)
type (str)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.Followers(*, href, total)
Bases:
ModelFollowers.
hrefis alwaysNone.- Parameters:
href (None)
total (int)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.Image(*, url, height, width)
Bases:
ModelImage link and information.
The Web API documentation reports that
heightandwidthcan beNoneor not available in the response.- Parameters:
url (str)
height (int | None)
width (int | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Model bases
Response model base. |
|
The response model contains an unknown attribute. |
|
Object identified with a Spotify ID. |
|
Identifiable with additional fields. |
|
Paging base. |
|
Offset paging base. |
|
Data cursor. |
|
Cursor paging base. |
Functionality
- class tekore.model.Model
Bases:
BaseModelResponse model base.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.UnknownModelAttributeWarning
Bases:
RuntimeWarningThe response model contains an unknown attribute.
Models
- class tekore.model.Identifiable(*, id)
Bases:
ModelObject identified with a Spotify ID.
- Parameters:
id (str)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.Item(*, id, href, type, uri)
Bases:
IdentifiableIdentifiable with additional fields.
- Parameters:
id (str)
href (str)
type (str)
uri (str)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.Paging(*, href, items, limit, next)
Bases:
ModelPaging base.
- Parameters:
href (str)
items (Sequence[Model | None])
limit (int)
next (str | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.OffsetPaging(*, href, items, limit, next, total, offset, previous)
Bases:
PagingOffset paging base.
Paging that can be navigated both forward and back.
- Parameters:
href (str)
items (Sequence[Model | None])
limit (int)
next (str | None)
total (int)
offset (int)
previous (str | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.Cursor(*, after)
Bases:
ModelData cursor.
- Parameters:
after (str | None)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tekore.model.CursorPaging(*, href, items, limit, next, cursors)
Bases:
PagingCursor paging base.
Paging that can be navigated only forward following the cursor.
- Parameters:
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Member types
- class tekore.model.StrEnum(value)
Bases:
str,EnumConvert enumeration members to strings using their name.
Ignores case when getting items. This does not change values.