spotify-apimatic-sdk 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- spotify_apimatic_sdk-1.0.0.dist-info/METADATA +150 -0
- spotify_apimatic_sdk-1.0.0.dist-info/RECORD +186 -0
- spotify_apimatic_sdk-1.0.0.dist-info/WHEEL +5 -0
- spotify_apimatic_sdk-1.0.0.dist-info/licenses/LICENSE +30 -0
- spotify_apimatic_sdk-1.0.0.dist-info/top_level.txt +1 -0
- spotifywebapi/__init__.py +12 -0
- spotifywebapi/api_helper.py +19 -0
- spotifywebapi/configuration.py +318 -0
- spotifywebapi/controllers/__init__.py +20 -0
- spotifywebapi/controllers/albums_controller.py +498 -0
- spotifywebapi/controllers/artists_controller.py +327 -0
- spotifywebapi/controllers/audiobooks_controller.py +441 -0
- spotifywebapi/controllers/base_controller.py +67 -0
- spotifywebapi/controllers/categories_controller.py +161 -0
- spotifywebapi/controllers/chapters_controller.py +157 -0
- spotifywebapi/controllers/episodes_controller.py +390 -0
- spotifywebapi/controllers/genres_controller.py +84 -0
- spotifywebapi/controllers/markets_controller.py +82 -0
- spotifywebapi/controllers/o_auth_authorization_controller.py +156 -0
- spotifywebapi/controllers/player_controller.py +807 -0
- spotifywebapi/controllers/playlists_controller.py +851 -0
- spotifywebapi/controllers/search_controller.py +123 -0
- spotifywebapi/controllers/shows_controller.py +439 -0
- spotifywebapi/controllers/tracks_controller.py +821 -0
- spotifywebapi/controllers/users_controller.py +649 -0
- spotifywebapi/exceptions/__init__.py +11 -0
- spotifywebapi/exceptions/api_exception.py +36 -0
- spotifywebapi/exceptions/bad_request_exception.py +56 -0
- spotifywebapi/exceptions/forbidden_exception.py +56 -0
- spotifywebapi/exceptions/not_found_exception.py +56 -0
- spotifywebapi/exceptions/o_auth_provider_exception.py +73 -0
- spotifywebapi/exceptions/too_many_requests_exception.py +56 -0
- spotifywebapi/exceptions/unauthorized_exception.py +56 -0
- spotifywebapi/http/__init__.py +11 -0
- spotifywebapi/http/api_response.py +67 -0
- spotifywebapi/http/auth/__init__.py +5 -0
- spotifywebapi/http/auth/o_auth_2.py +336 -0
- spotifywebapi/http/http_call_back.py +20 -0
- spotifywebapi/http/http_client_provider.py +23 -0
- spotifywebapi/http/http_method_enum.py +25 -0
- spotifywebapi/http/http_request.py +55 -0
- spotifywebapi/http/http_response.py +45 -0
- spotifywebapi/http/proxy_settings.py +50 -0
- spotifywebapi/models/__init__.py +142 -0
- spotifywebapi/models/album_base.py +264 -0
- spotifywebapi/models/album_group_enum.py +51 -0
- spotifywebapi/models/album_object.py +375 -0
- spotifywebapi/models/album_restriction_object.py +109 -0
- spotifywebapi/models/album_type_enum.py +62 -0
- spotifywebapi/models/artist_discography_album_object.py +298 -0
- spotifywebapi/models/artist_object.py +335 -0
- spotifywebapi/models/audio_analysis_object.py +266 -0
- spotifywebapi/models/audio_features_object.py +518 -0
- spotifywebapi/models/audiobook_base.py +353 -0
- spotifywebapi/models/audiobook_object.py +369 -0
- spotifywebapi/models/author_object.py +85 -0
- spotifywebapi/models/categories.py +162 -0
- spotifywebapi/models/category_object.py +117 -0
- spotifywebapi/models/chapter_base.py +392 -0
- spotifywebapi/models/chapter_object.py +408 -0
- spotifywebapi/models/chapter_restriction_object.py +113 -0
- spotifywebapi/models/context_object.py +181 -0
- spotifywebapi/models/copyright_object.py +130 -0
- spotifywebapi/models/currently_playing_context_object.py +314 -0
- spotifywebapi/models/currently_playing_object.py +241 -0
- spotifywebapi/models/cursor_object.py +108 -0
- spotifywebapi/models/cursor_paged_artists.py +75 -0
- spotifywebapi/models/cursor_paging_object.py +183 -0
- spotifywebapi/models/cursor_paging_play_history_object.py +214 -0
- spotifywebapi/models/cursor_paging_simplified_artist_object.py +213 -0
- spotifywebapi/models/device_object.py +278 -0
- spotifywebapi/models/disallows_object.py +314 -0
- spotifywebapi/models/episode_base.py +394 -0
- spotifywebapi/models/episode_object.py +665 -0
- spotifywebapi/models/episode_restriction_object.py +112 -0
- spotifywebapi/models/error_object.py +85 -0
- spotifywebapi/models/explicit_content_settings_object.py +110 -0
- spotifywebapi/models/external_id_object.py +156 -0
- spotifywebapi/models/external_url_object.py +107 -0
- spotifywebapi/models/followers_object.py +134 -0
- spotifywebapi/models/image_object.py +168 -0
- spotifywebapi/models/include_external_enum.py +45 -0
- spotifywebapi/models/item_type_1_enum.py +56 -0
- spotifywebapi/models/item_type_2_enum.py +45 -0
- spotifywebapi/models/item_type_3_enum.py +45 -0
- spotifywebapi/models/item_type_enum.py +58 -0
- spotifywebapi/models/linked_track_object.py +205 -0
- spotifywebapi/models/many_albums.py +76 -0
- spotifywebapi/models/many_artists.py +76 -0
- spotifywebapi/models/many_audio_features.py +77 -0
- spotifywebapi/models/many_audiobooks.py +77 -0
- spotifywebapi/models/many_chapters.py +77 -0
- spotifywebapi/models/many_devices.py +76 -0
- spotifywebapi/models/many_episodes.py +77 -0
- spotifywebapi/models/many_genres.py +69 -0
- spotifywebapi/models/many_simplified_shows.py +74 -0
- spotifywebapi/models/many_tracks.py +76 -0
- spotifywebapi/models/markets.py +85 -0
- spotifywebapi/models/me_albums_request.py +90 -0
- spotifywebapi/models/me_episodes_request.py +73 -0
- spotifywebapi/models/me_episodes_request_1.py +89 -0
- spotifywebapi/models/me_following_request.py +74 -0
- spotifywebapi/models/me_following_request_1.py +90 -0
- spotifywebapi/models/me_player_play_request.py +165 -0
- spotifywebapi/models/me_player_request.py +103 -0
- spotifywebapi/models/me_shows_request.py +89 -0
- spotifywebapi/models/me_tracks_request.py +74 -0
- spotifywebapi/models/me_tracks_request_1.py +90 -0
- spotifywebapi/models/meta.py +227 -0
- spotifywebapi/models/mode_enum.py +52 -0
- spotifywebapi/models/narrator_object.py +85 -0
- spotifywebapi/models/o_auth_provider_error_enum.py +67 -0
- spotifywebapi/models/o_auth_scope_enum.py +98 -0
- spotifywebapi/models/o_auth_token.py +113 -0
- spotifywebapi/models/paged_albums.py +75 -0
- spotifywebapi/models/paged_categories.py +74 -0
- spotifywebapi/models/paging_artist_discography_album_object.py +163 -0
- spotifywebapi/models/paging_artist_object.py +162 -0
- spotifywebapi/models/paging_featured_playlist_object.py +113 -0
- spotifywebapi/models/paging_object.py +142 -0
- spotifywebapi/models/paging_playlist_object.py +163 -0
- spotifywebapi/models/paging_playlist_track_object.py +163 -0
- spotifywebapi/models/paging_saved_album_object.py +163 -0
- spotifywebapi/models/paging_saved_audiobook_object.py +163 -0
- spotifywebapi/models/paging_saved_episode_object.py +163 -0
- spotifywebapi/models/paging_saved_show_object.py +163 -0
- spotifywebapi/models/paging_saved_track_object.py +163 -0
- spotifywebapi/models/paging_simplified_album_object.py +163 -0
- spotifywebapi/models/paging_simplified_audiobook_object.py +162 -0
- spotifywebapi/models/paging_simplified_chapter_object.py +162 -0
- spotifywebapi/models/paging_simplified_episode_object.py +162 -0
- spotifywebapi/models/paging_simplified_show_object.py +160 -0
- spotifywebapi/models/paging_simplified_track_object.py +163 -0
- spotifywebapi/models/paging_track_object.py +162 -0
- spotifywebapi/models/play_history_object.py +141 -0
- spotifywebapi/models/playlist_object.py +425 -0
- spotifywebapi/models/playlist_owner_object.py +238 -0
- spotifywebapi/models/playlist_snapshot_id.py +85 -0
- spotifywebapi/models/playlist_track_object.py +171 -0
- spotifywebapi/models/playlist_tracks_ref_object.py +109 -0
- spotifywebapi/models/playlist_user_object.py +231 -0
- spotifywebapi/models/playlists_followers_request.py +86 -0
- spotifywebapi/models/playlists_request.py +160 -0
- spotifywebapi/models/playlists_tracks_request.py +121 -0
- spotifywebapi/models/playlists_tracks_request_1.py +188 -0
- spotifywebapi/models/playlists_tracks_request_2.py +109 -0
- spotifywebapi/models/private_user_object.py +379 -0
- spotifywebapi/models/public_user_object.py +268 -0
- spotifywebapi/models/queue_object.py +118 -0
- spotifywebapi/models/reason_enum.py +65 -0
- spotifywebapi/models/recommendation_seed_object.py +208 -0
- spotifywebapi/models/recommendations_object.py +96 -0
- spotifywebapi/models/release_date_precision_enum.py +62 -0
- spotifywebapi/models/resume_point_object.py +131 -0
- spotifywebapi/models/saved_album_object.py +118 -0
- spotifywebapi/models/saved_audiobook_object.py +118 -0
- spotifywebapi/models/saved_episode_object.py +116 -0
- spotifywebapi/models/saved_show_object.py +116 -0
- spotifywebapi/models/saved_track_object.py +118 -0
- spotifywebapi/models/search_items.py +256 -0
- spotifywebapi/models/section_object.py +362 -0
- spotifywebapi/models/segment_object.py +307 -0
- spotifywebapi/models/show_base.py +550 -0
- spotifywebapi/models/show_object.py +319 -0
- spotifywebapi/models/simplified_album_object.py +468 -0
- spotifywebapi/models/simplified_artist_object.py +228 -0
- spotifywebapi/models/simplified_playlist_object.py +398 -0
- spotifywebapi/models/simplified_track_object.py +494 -0
- spotifywebapi/models/time_interval_object.py +132 -0
- spotifywebapi/models/track.py +697 -0
- spotifywebapi/models/track_1.py +85 -0
- spotifywebapi/models/track_object.py +605 -0
- spotifywebapi/models/track_restriction_object.py +112 -0
- spotifywebapi/models/type_2_enum.py +56 -0
- spotifywebapi/models/type_3_enum.py +56 -0
- spotifywebapi/models/type_4_enum.py +56 -0
- spotifywebapi/models/type_5_enum.py +56 -0
- spotifywebapi/models/type_6_enum.py +56 -0
- spotifywebapi/models/type_8_enum.py +42 -0
- spotifywebapi/models/type_9_enum.py +42 -0
- spotifywebapi/models/type_enum.py +56 -0
- spotifywebapi/models/users_playlists_request.py +154 -0
- spotifywebapi/spotifywebapi_client.py +198 -0
- spotifywebapi/utilities/__init__.py +6 -0
- spotifywebapi/utilities/file_wrapper.py +45 -0
- spotifywebapi/utilities/union_type_lookup.py +113 -0
|
@@ -0,0 +1,518 @@
|
|
|
1
|
+
"""spotifywebapi.
|
|
2
|
+
|
|
3
|
+
This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
# ruff: noqa: E501
|
|
7
|
+
from spotifywebapi.api_helper import APIHelper
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class AudioFeaturesObject(object):
|
|
11
|
+
"""Implementation of the 'AudioFeaturesObject' model.
|
|
12
|
+
|
|
13
|
+
Attributes:
|
|
14
|
+
acousticness (float): A confidence measure from 0.0 to 1.0 of whether the
|
|
15
|
+
track is acoustic. 1.0 represents high confidence the track is acoustic.
|
|
16
|
+
analysis_url (str): A URL to access the full audio analysis of this track. An
|
|
17
|
+
access token is required to access this data.
|
|
18
|
+
danceability (float): Danceability describes how suitable a track is for
|
|
19
|
+
dancing based on a combination of musical elements including tempo,
|
|
20
|
+
rhythm stability, beat strength, and overall regularity. A value of 0.0
|
|
21
|
+
is least danceable and 1.0 is most danceable.
|
|
22
|
+
duration_ms (int): The duration of the track in milliseconds.
|
|
23
|
+
energy (float): Energy is a measure from 0.0 to 1.0 and represents a
|
|
24
|
+
perceptual measure of intensity and activity. Typically, energetic tracks
|
|
25
|
+
feel fast, loud, and noisy. For example, death metal has high energy,
|
|
26
|
+
while a Bach prelude scores low on the scale. Perceptual features
|
|
27
|
+
contributing to this attribute include dynamic range, perceived loudness,
|
|
28
|
+
timbre, onset rate, and general entropy.
|
|
29
|
+
id (str): The Spotify ID for the track.
|
|
30
|
+
instrumentalness (float): Predicts whether a track contains no vocals. "Ooh"
|
|
31
|
+
and "aah" sounds are treated as instrumental in this context. Rap or
|
|
32
|
+
spoken word tracks are clearly "vocal". The closer the instrumentalness
|
|
33
|
+
value is to 1.0, the greater likelihood the track contains no vocal
|
|
34
|
+
content. Values above 0.5 are intended to represent instrumental tracks,
|
|
35
|
+
but confidence is higher as the value approaches 1.0.
|
|
36
|
+
key (int): The key the track is in. Integers map to pitches using standard
|
|
37
|
+
[Pitch Class notation](https://en.wikipedia.org/wiki/Pitch_class). E.g. 0
|
|
38
|
+
= C, 1 = C♯/D♭, 2 = D, and so on. If no key was detected, the value is -1.
|
|
39
|
+
liveness (float): Detects the presence of an audience in the recording.
|
|
40
|
+
Higher liveness values represent an increased probability that the track
|
|
41
|
+
was performed live. A value above 0.8 provides strong likelihood that the
|
|
42
|
+
track is live.
|
|
43
|
+
loudness (float): The overall loudness of a track in decibels (dB). Loudness
|
|
44
|
+
values are averaged across the entire track and are useful for comparing
|
|
45
|
+
relative loudness of tracks. Loudness is the quality of a sound that is
|
|
46
|
+
the primary psychological correlate of physical strength (amplitude).
|
|
47
|
+
Values typically range between -60 and 0 db.
|
|
48
|
+
mode (int): Mode indicates the modality (major or minor) of a track, the type
|
|
49
|
+
of scale from which its melodic content is derived. Major is represented
|
|
50
|
+
by 1 and minor is 0.
|
|
51
|
+
speechiness (float): Speechiness detects the presence of spoken words in a
|
|
52
|
+
track. The more exclusively speech-like the recording (e.g. talk show,
|
|
53
|
+
audio book, poetry), the closer to 1.0 the attribute value. Values above
|
|
54
|
+
0.66 describe tracks that are probably made entirely of spoken words.
|
|
55
|
+
Values between 0.33 and 0.66 describe tracks that may contain both music
|
|
56
|
+
and speech, either in sections or layered, including such cases as rap
|
|
57
|
+
music. Values below 0.33 most likely represent music and other
|
|
58
|
+
non-speech-like tracks.
|
|
59
|
+
tempo (float): The overall estimated tempo of a track in beats per minute
|
|
60
|
+
(BPM). In musical terminology, tempo is the speed or pace of a given
|
|
61
|
+
piece and derives directly from the average beat duration.
|
|
62
|
+
time_signature (int): An estimated time signature. The time signature (meter)
|
|
63
|
+
is a notational convention to specify how many beats are in each bar (or
|
|
64
|
+
measure). The time signature ranges from 3 to 7 indicating time
|
|
65
|
+
signatures of "3/4", to "7/4".
|
|
66
|
+
track_href (str): A link to the Web API endpoint providing full details of
|
|
67
|
+
the track.
|
|
68
|
+
mtype (Type8Enum): The object type.
|
|
69
|
+
uri (str): The Spotify URI for the track.
|
|
70
|
+
valence (float): A measure from 0.0 to 1.0 describing the musical
|
|
71
|
+
positiveness conveyed by a track. Tracks with high valence sound more
|
|
72
|
+
positive (e.g. happy, cheerful, euphoric), while tracks with low valence
|
|
73
|
+
sound more negative (e.g. sad, depressed, angry).
|
|
74
|
+
|
|
75
|
+
"""
|
|
76
|
+
|
|
77
|
+
# Create a mapping from Model property names to API property names
|
|
78
|
+
_names = {
|
|
79
|
+
"acousticness": "acousticness",
|
|
80
|
+
"analysis_url": "analysis_url",
|
|
81
|
+
"danceability": "danceability",
|
|
82
|
+
"duration_ms": "duration_ms",
|
|
83
|
+
"energy": "energy",
|
|
84
|
+
"id": "id",
|
|
85
|
+
"instrumentalness": "instrumentalness",
|
|
86
|
+
"key": "key",
|
|
87
|
+
"liveness": "liveness",
|
|
88
|
+
"loudness": "loudness",
|
|
89
|
+
"mode": "mode",
|
|
90
|
+
"speechiness": "speechiness",
|
|
91
|
+
"tempo": "tempo",
|
|
92
|
+
"time_signature": "time_signature",
|
|
93
|
+
"track_href": "track_href",
|
|
94
|
+
"mtype": "type",
|
|
95
|
+
"uri": "uri",
|
|
96
|
+
"valence": "valence",
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
_optionals = [
|
|
100
|
+
"acousticness",
|
|
101
|
+
"analysis_url",
|
|
102
|
+
"danceability",
|
|
103
|
+
"duration_ms",
|
|
104
|
+
"energy",
|
|
105
|
+
"id",
|
|
106
|
+
"instrumentalness",
|
|
107
|
+
"key",
|
|
108
|
+
"liveness",
|
|
109
|
+
"loudness",
|
|
110
|
+
"mode",
|
|
111
|
+
"speechiness",
|
|
112
|
+
"tempo",
|
|
113
|
+
"time_signature",
|
|
114
|
+
"track_href",
|
|
115
|
+
"mtype",
|
|
116
|
+
"uri",
|
|
117
|
+
"valence",
|
|
118
|
+
]
|
|
119
|
+
|
|
120
|
+
def __init__(
|
|
121
|
+
self,
|
|
122
|
+
acousticness=APIHelper.SKIP,
|
|
123
|
+
analysis_url=APIHelper.SKIP,
|
|
124
|
+
danceability=APIHelper.SKIP,
|
|
125
|
+
duration_ms=APIHelper.SKIP,
|
|
126
|
+
energy=APIHelper.SKIP,
|
|
127
|
+
id=APIHelper.SKIP,
|
|
128
|
+
instrumentalness=APIHelper.SKIP,
|
|
129
|
+
key=APIHelper.SKIP,
|
|
130
|
+
liveness=APIHelper.SKIP,
|
|
131
|
+
loudness=APIHelper.SKIP,
|
|
132
|
+
mode=APIHelper.SKIP,
|
|
133
|
+
speechiness=APIHelper.SKIP,
|
|
134
|
+
tempo=APIHelper.SKIP,
|
|
135
|
+
time_signature=APIHelper.SKIP,
|
|
136
|
+
track_href=APIHelper.SKIP,
|
|
137
|
+
mtype=APIHelper.SKIP,
|
|
138
|
+
uri=APIHelper.SKIP,
|
|
139
|
+
valence=APIHelper.SKIP):
|
|
140
|
+
"""Initialize a AudioFeaturesObject instance."""
|
|
141
|
+
# Initialize members of the class
|
|
142
|
+
if acousticness is not APIHelper.SKIP:
|
|
143
|
+
self.acousticness = acousticness
|
|
144
|
+
if analysis_url is not APIHelper.SKIP:
|
|
145
|
+
self.analysis_url = analysis_url
|
|
146
|
+
if danceability is not APIHelper.SKIP:
|
|
147
|
+
self.danceability = danceability
|
|
148
|
+
if duration_ms is not APIHelper.SKIP:
|
|
149
|
+
self.duration_ms = duration_ms
|
|
150
|
+
if energy is not APIHelper.SKIP:
|
|
151
|
+
self.energy = energy
|
|
152
|
+
if id is not APIHelper.SKIP:
|
|
153
|
+
self.id = id
|
|
154
|
+
if instrumentalness is not APIHelper.SKIP:
|
|
155
|
+
self.instrumentalness = instrumentalness
|
|
156
|
+
if key is not APIHelper.SKIP:
|
|
157
|
+
self.key = key
|
|
158
|
+
if liveness is not APIHelper.SKIP:
|
|
159
|
+
self.liveness = liveness
|
|
160
|
+
if loudness is not APIHelper.SKIP:
|
|
161
|
+
self.loudness = loudness
|
|
162
|
+
if mode is not APIHelper.SKIP:
|
|
163
|
+
self.mode = mode
|
|
164
|
+
if speechiness is not APIHelper.SKIP:
|
|
165
|
+
self.speechiness = speechiness
|
|
166
|
+
if tempo is not APIHelper.SKIP:
|
|
167
|
+
self.tempo = tempo
|
|
168
|
+
if time_signature is not APIHelper.SKIP:
|
|
169
|
+
self.time_signature = time_signature
|
|
170
|
+
if track_href is not APIHelper.SKIP:
|
|
171
|
+
self.track_href = track_href
|
|
172
|
+
if mtype is not APIHelper.SKIP:
|
|
173
|
+
self.mtype = mtype
|
|
174
|
+
if uri is not APIHelper.SKIP:
|
|
175
|
+
self.uri = uri
|
|
176
|
+
if valence is not APIHelper.SKIP:
|
|
177
|
+
self.valence = valence
|
|
178
|
+
|
|
179
|
+
@classmethod
|
|
180
|
+
def from_dictionary(cls,
|
|
181
|
+
dictionary):
|
|
182
|
+
"""Create an instance of this model from a dictionary
|
|
183
|
+
|
|
184
|
+
Args:
|
|
185
|
+
dictionary (dictionary): A dictionary representation of the object
|
|
186
|
+
as obtained from the deserialization of the server's response. The
|
|
187
|
+
keys MUST match property names in the API description.
|
|
188
|
+
|
|
189
|
+
Returns:
|
|
190
|
+
object: An instance of this structure class.
|
|
191
|
+
|
|
192
|
+
"""
|
|
193
|
+
if not isinstance(dictionary, dict) or dictionary is None:
|
|
194
|
+
return None
|
|
195
|
+
|
|
196
|
+
# Extract variables from the dictionary
|
|
197
|
+
acousticness =\
|
|
198
|
+
dictionary.get("acousticness")\
|
|
199
|
+
if dictionary.get("acousticness")\
|
|
200
|
+
else APIHelper.SKIP
|
|
201
|
+
analysis_url =\
|
|
202
|
+
dictionary.get("analysis_url")\
|
|
203
|
+
if dictionary.get("analysis_url")\
|
|
204
|
+
else APIHelper.SKIP
|
|
205
|
+
danceability =\
|
|
206
|
+
dictionary.get("danceability")\
|
|
207
|
+
if dictionary.get("danceability")\
|
|
208
|
+
else APIHelper.SKIP
|
|
209
|
+
duration_ms =\
|
|
210
|
+
dictionary.get("duration_ms")\
|
|
211
|
+
if dictionary.get("duration_ms")\
|
|
212
|
+
else APIHelper.SKIP
|
|
213
|
+
energy =\
|
|
214
|
+
dictionary.get("energy")\
|
|
215
|
+
if dictionary.get("energy")\
|
|
216
|
+
else APIHelper.SKIP
|
|
217
|
+
id =\
|
|
218
|
+
dictionary.get("id")\
|
|
219
|
+
if dictionary.get("id")\
|
|
220
|
+
else APIHelper.SKIP
|
|
221
|
+
instrumentalness =\
|
|
222
|
+
dictionary.get("instrumentalness")\
|
|
223
|
+
if dictionary.get("instrumentalness")\
|
|
224
|
+
else APIHelper.SKIP
|
|
225
|
+
key =\
|
|
226
|
+
dictionary.get("key")\
|
|
227
|
+
if dictionary.get("key")\
|
|
228
|
+
else APIHelper.SKIP
|
|
229
|
+
liveness =\
|
|
230
|
+
dictionary.get("liveness")\
|
|
231
|
+
if dictionary.get("liveness")\
|
|
232
|
+
else APIHelper.SKIP
|
|
233
|
+
loudness =\
|
|
234
|
+
dictionary.get("loudness")\
|
|
235
|
+
if dictionary.get("loudness")\
|
|
236
|
+
else APIHelper.SKIP
|
|
237
|
+
mode =\
|
|
238
|
+
dictionary.get("mode")\
|
|
239
|
+
if dictionary.get("mode")\
|
|
240
|
+
else APIHelper.SKIP
|
|
241
|
+
speechiness =\
|
|
242
|
+
dictionary.get("speechiness")\
|
|
243
|
+
if dictionary.get("speechiness")\
|
|
244
|
+
else APIHelper.SKIP
|
|
245
|
+
tempo =\
|
|
246
|
+
dictionary.get("tempo")\
|
|
247
|
+
if dictionary.get("tempo")\
|
|
248
|
+
else APIHelper.SKIP
|
|
249
|
+
time_signature =\
|
|
250
|
+
dictionary.get("time_signature")\
|
|
251
|
+
if dictionary.get("time_signature")\
|
|
252
|
+
else APIHelper.SKIP
|
|
253
|
+
track_href =\
|
|
254
|
+
dictionary.get("track_href")\
|
|
255
|
+
if dictionary.get("track_href")\
|
|
256
|
+
else APIHelper.SKIP
|
|
257
|
+
mtype =\
|
|
258
|
+
dictionary.get("type")\
|
|
259
|
+
if dictionary.get("type")\
|
|
260
|
+
else APIHelper.SKIP
|
|
261
|
+
uri =\
|
|
262
|
+
dictionary.get("uri")\
|
|
263
|
+
if dictionary.get("uri")\
|
|
264
|
+
else APIHelper.SKIP
|
|
265
|
+
valence =\
|
|
266
|
+
dictionary.get("valence")\
|
|
267
|
+
if dictionary.get("valence")\
|
|
268
|
+
else APIHelper.SKIP
|
|
269
|
+
|
|
270
|
+
# Return an object of this model
|
|
271
|
+
return cls(acousticness,
|
|
272
|
+
analysis_url,
|
|
273
|
+
danceability,
|
|
274
|
+
duration_ms,
|
|
275
|
+
energy,
|
|
276
|
+
id,
|
|
277
|
+
instrumentalness,
|
|
278
|
+
key,
|
|
279
|
+
liveness,
|
|
280
|
+
loudness,
|
|
281
|
+
mode,
|
|
282
|
+
speechiness,
|
|
283
|
+
tempo,
|
|
284
|
+
time_signature,
|
|
285
|
+
track_href,
|
|
286
|
+
mtype,
|
|
287
|
+
uri,
|
|
288
|
+
valence)
|
|
289
|
+
|
|
290
|
+
def __repr__(self):
|
|
291
|
+
"""Return a unambiguous string representation."""
|
|
292
|
+
_acousticness=(
|
|
293
|
+
self.acousticness
|
|
294
|
+
if hasattr(self, "acousticness")
|
|
295
|
+
else None
|
|
296
|
+
)
|
|
297
|
+
_analysis_url=(
|
|
298
|
+
self.analysis_url
|
|
299
|
+
if hasattr(self, "analysis_url")
|
|
300
|
+
else None
|
|
301
|
+
)
|
|
302
|
+
_danceability=(
|
|
303
|
+
self.danceability
|
|
304
|
+
if hasattr(self, "danceability")
|
|
305
|
+
else None
|
|
306
|
+
)
|
|
307
|
+
_duration_ms=(
|
|
308
|
+
self.duration_ms
|
|
309
|
+
if hasattr(self, "duration_ms")
|
|
310
|
+
else None
|
|
311
|
+
)
|
|
312
|
+
_energy=(
|
|
313
|
+
self.energy
|
|
314
|
+
if hasattr(self, "energy")
|
|
315
|
+
else None
|
|
316
|
+
)
|
|
317
|
+
_id=(
|
|
318
|
+
self.id
|
|
319
|
+
if hasattr(self, "id")
|
|
320
|
+
else None
|
|
321
|
+
)
|
|
322
|
+
_instrumentalness=(
|
|
323
|
+
self.instrumentalness
|
|
324
|
+
if hasattr(self, "instrumentalness")
|
|
325
|
+
else None
|
|
326
|
+
)
|
|
327
|
+
_key=(
|
|
328
|
+
self.key
|
|
329
|
+
if hasattr(self, "key")
|
|
330
|
+
else None
|
|
331
|
+
)
|
|
332
|
+
_liveness=(
|
|
333
|
+
self.liveness
|
|
334
|
+
if hasattr(self, "liveness")
|
|
335
|
+
else None
|
|
336
|
+
)
|
|
337
|
+
_loudness=(
|
|
338
|
+
self.loudness
|
|
339
|
+
if hasattr(self, "loudness")
|
|
340
|
+
else None
|
|
341
|
+
)
|
|
342
|
+
_mode=(
|
|
343
|
+
self.mode
|
|
344
|
+
if hasattr(self, "mode")
|
|
345
|
+
else None
|
|
346
|
+
)
|
|
347
|
+
_speechiness=(
|
|
348
|
+
self.speechiness
|
|
349
|
+
if hasattr(self, "speechiness")
|
|
350
|
+
else None
|
|
351
|
+
)
|
|
352
|
+
_tempo=(
|
|
353
|
+
self.tempo
|
|
354
|
+
if hasattr(self, "tempo")
|
|
355
|
+
else None
|
|
356
|
+
)
|
|
357
|
+
_time_signature=(
|
|
358
|
+
self.time_signature
|
|
359
|
+
if hasattr(self, "time_signature")
|
|
360
|
+
else None
|
|
361
|
+
)
|
|
362
|
+
_track_href=(
|
|
363
|
+
self.track_href
|
|
364
|
+
if hasattr(self, "track_href")
|
|
365
|
+
else None
|
|
366
|
+
)
|
|
367
|
+
_mtype=(
|
|
368
|
+
self.mtype
|
|
369
|
+
if hasattr(self, "mtype")
|
|
370
|
+
else None
|
|
371
|
+
)
|
|
372
|
+
_uri=(
|
|
373
|
+
self.uri
|
|
374
|
+
if hasattr(self, "uri")
|
|
375
|
+
else None
|
|
376
|
+
)
|
|
377
|
+
_valence=(
|
|
378
|
+
self.valence
|
|
379
|
+
if hasattr(self, "valence")
|
|
380
|
+
else None
|
|
381
|
+
)
|
|
382
|
+
return (
|
|
383
|
+
f"{self.__class__.__name__}("
|
|
384
|
+
f"acousticness={_acousticness!r}, "
|
|
385
|
+
f"analysis_url={_analysis_url!r}, "
|
|
386
|
+
f"danceability={_danceability!r}, "
|
|
387
|
+
f"duration_ms={_duration_ms!r}, "
|
|
388
|
+
f"energy={_energy!r}, "
|
|
389
|
+
f"id={_id!r}, "
|
|
390
|
+
f"instrumentalness={_instrumentalness!r}, "
|
|
391
|
+
f"key={_key!r}, "
|
|
392
|
+
f"liveness={_liveness!r}, "
|
|
393
|
+
f"loudness={_loudness!r}, "
|
|
394
|
+
f"mode={_mode!r}, "
|
|
395
|
+
f"speechiness={_speechiness!r}, "
|
|
396
|
+
f"tempo={_tempo!r}, "
|
|
397
|
+
f"time_signature={_time_signature!r}, "
|
|
398
|
+
f"track_href={_track_href!r}, "
|
|
399
|
+
f"mtype={_mtype!r}, "
|
|
400
|
+
f"uri={_uri!r}, "
|
|
401
|
+
f"valence={_valence!r}, "
|
|
402
|
+
f")"
|
|
403
|
+
)
|
|
404
|
+
|
|
405
|
+
def __str__(self):
|
|
406
|
+
"""Return a human-readable string representation."""
|
|
407
|
+
_acousticness=(
|
|
408
|
+
self.acousticness
|
|
409
|
+
if hasattr(self, "acousticness")
|
|
410
|
+
else None
|
|
411
|
+
)
|
|
412
|
+
_analysis_url=(
|
|
413
|
+
self.analysis_url
|
|
414
|
+
if hasattr(self, "analysis_url")
|
|
415
|
+
else None
|
|
416
|
+
)
|
|
417
|
+
_danceability=(
|
|
418
|
+
self.danceability
|
|
419
|
+
if hasattr(self, "danceability")
|
|
420
|
+
else None
|
|
421
|
+
)
|
|
422
|
+
_duration_ms=(
|
|
423
|
+
self.duration_ms
|
|
424
|
+
if hasattr(self, "duration_ms")
|
|
425
|
+
else None
|
|
426
|
+
)
|
|
427
|
+
_energy=(
|
|
428
|
+
self.energy
|
|
429
|
+
if hasattr(self, "energy")
|
|
430
|
+
else None
|
|
431
|
+
)
|
|
432
|
+
_id=(
|
|
433
|
+
self.id
|
|
434
|
+
if hasattr(self, "id")
|
|
435
|
+
else None
|
|
436
|
+
)
|
|
437
|
+
_instrumentalness=(
|
|
438
|
+
self.instrumentalness
|
|
439
|
+
if hasattr(self, "instrumentalness")
|
|
440
|
+
else None
|
|
441
|
+
)
|
|
442
|
+
_key=(
|
|
443
|
+
self.key
|
|
444
|
+
if hasattr(self, "key")
|
|
445
|
+
else None
|
|
446
|
+
)
|
|
447
|
+
_liveness=(
|
|
448
|
+
self.liveness
|
|
449
|
+
if hasattr(self, "liveness")
|
|
450
|
+
else None
|
|
451
|
+
)
|
|
452
|
+
_loudness=(
|
|
453
|
+
self.loudness
|
|
454
|
+
if hasattr(self, "loudness")
|
|
455
|
+
else None
|
|
456
|
+
)
|
|
457
|
+
_mode=(
|
|
458
|
+
self.mode
|
|
459
|
+
if hasattr(self, "mode")
|
|
460
|
+
else None
|
|
461
|
+
)
|
|
462
|
+
_speechiness=(
|
|
463
|
+
self.speechiness
|
|
464
|
+
if hasattr(self, "speechiness")
|
|
465
|
+
else None
|
|
466
|
+
)
|
|
467
|
+
_tempo=(
|
|
468
|
+
self.tempo
|
|
469
|
+
if hasattr(self, "tempo")
|
|
470
|
+
else None
|
|
471
|
+
)
|
|
472
|
+
_time_signature=(
|
|
473
|
+
self.time_signature
|
|
474
|
+
if hasattr(self, "time_signature")
|
|
475
|
+
else None
|
|
476
|
+
)
|
|
477
|
+
_track_href=(
|
|
478
|
+
self.track_href
|
|
479
|
+
if hasattr(self, "track_href")
|
|
480
|
+
else None
|
|
481
|
+
)
|
|
482
|
+
_mtype=(
|
|
483
|
+
self.mtype
|
|
484
|
+
if hasattr(self, "mtype")
|
|
485
|
+
else None
|
|
486
|
+
)
|
|
487
|
+
_uri=(
|
|
488
|
+
self.uri
|
|
489
|
+
if hasattr(self, "uri")
|
|
490
|
+
else None
|
|
491
|
+
)
|
|
492
|
+
_valence=(
|
|
493
|
+
self.valence
|
|
494
|
+
if hasattr(self, "valence")
|
|
495
|
+
else None
|
|
496
|
+
)
|
|
497
|
+
return (
|
|
498
|
+
f"{self.__class__.__name__}("
|
|
499
|
+
f"acousticness={_acousticness!s}, "
|
|
500
|
+
f"analysis_url={_analysis_url!s}, "
|
|
501
|
+
f"danceability={_danceability!s}, "
|
|
502
|
+
f"duration_ms={_duration_ms!s}, "
|
|
503
|
+
f"energy={_energy!s}, "
|
|
504
|
+
f"id={_id!s}, "
|
|
505
|
+
f"instrumentalness={_instrumentalness!s}, "
|
|
506
|
+
f"key={_key!s}, "
|
|
507
|
+
f"liveness={_liveness!s}, "
|
|
508
|
+
f"loudness={_loudness!s}, "
|
|
509
|
+
f"mode={_mode!s}, "
|
|
510
|
+
f"speechiness={_speechiness!s}, "
|
|
511
|
+
f"tempo={_tempo!s}, "
|
|
512
|
+
f"time_signature={_time_signature!s}, "
|
|
513
|
+
f"track_href={_track_href!s}, "
|
|
514
|
+
f"mtype={_mtype!s}, "
|
|
515
|
+
f"uri={_uri!s}, "
|
|
516
|
+
f"valence={_valence!s}, "
|
|
517
|
+
f")"
|
|
518
|
+
)
|