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,697 @@
|
|
|
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 Track(object):
|
|
11
|
+
"""Implementation of the 'Track' model.
|
|
12
|
+
|
|
13
|
+
Attributes:
|
|
14
|
+
num_samples (int): The exact number of audio samples analyzed from this
|
|
15
|
+
track. See also `analysis_sample_rate`.
|
|
16
|
+
duration (float): Length of the track in seconds.
|
|
17
|
+
sample_md_5 (str): This field will always contain the empty string.
|
|
18
|
+
offset_seconds (int): An offset to the start of the region of the track that
|
|
19
|
+
was analyzed. (As the entire track is analyzed, this should always be 0.)
|
|
20
|
+
window_seconds (int): The length of the region of the track was analyzed, if
|
|
21
|
+
a subset of the track was analyzed. (As the entire track is analyzed,
|
|
22
|
+
this should always be 0.)
|
|
23
|
+
analysis_sample_rate (int): The sample rate used to decode and analyze this
|
|
24
|
+
track. May differ from the actual sample rate of this track available on
|
|
25
|
+
Spotify.
|
|
26
|
+
analysis_channels (int): The number of channels used for analysis. If 1, all
|
|
27
|
+
channels are summed together to mono before analysis.
|
|
28
|
+
end_of_fade_in (float): The time, in seconds, at which the track's fade-in
|
|
29
|
+
period ends. If the track has no fade-in, this will be 0.0.
|
|
30
|
+
start_of_fade_out (float): The time, in seconds, at which the track's
|
|
31
|
+
fade-out period starts. If the track has no fade-out, this should match
|
|
32
|
+
the track's length.
|
|
33
|
+
loudness (float): The overall loudness of a track in decibels (dB). Loudness
|
|
34
|
+
values are averaged across the entire track and are useful for comparing
|
|
35
|
+
relative loudness of tracks. Loudness is the quality of a sound that is
|
|
36
|
+
the primary psychological correlate of physical strength (amplitude).
|
|
37
|
+
Values typically range between -60 and 0 db.
|
|
38
|
+
tempo (float): The overall estimated tempo of a track in beats per minute
|
|
39
|
+
(BPM). In musical terminology, tempo is the speed or pace of a given
|
|
40
|
+
piece and derives directly from the average beat duration.
|
|
41
|
+
tempo_confidence (float): The confidence, from 0.0 to 1.0, of the reliability
|
|
42
|
+
of the `tempo`.
|
|
43
|
+
time_signature (int): An estimated time signature. The time signature (meter)
|
|
44
|
+
is a notational convention to specify how many beats are in each bar (or
|
|
45
|
+
measure). The time signature ranges from 3 to 7 indicating time
|
|
46
|
+
signatures of "3/4", to "7/4".
|
|
47
|
+
time_signature_confidence (float): The confidence, from 0.0 to 1.0, of the
|
|
48
|
+
reliability of the `time_signature`.
|
|
49
|
+
key (int): The key the track is in. Integers map to pitches using standard
|
|
50
|
+
[Pitch Class notation](https://en.wikipedia.org/wiki/Pitch_class). E.g. 0
|
|
51
|
+
= C, 1 = C♯/D♭, 2 = D, and so on. If no key was detected, the value is -1.
|
|
52
|
+
key_confidence (float): The confidence, from 0.0 to 1.0, of the reliability
|
|
53
|
+
of the `key`.
|
|
54
|
+
mode (int): Mode indicates the modality (major or minor) of a track, the type
|
|
55
|
+
of scale from which its melodic content is derived. Major is represented
|
|
56
|
+
by 1 and minor is 0.
|
|
57
|
+
mode_confidence (float): The confidence, from 0.0 to 1.0, of the reliability
|
|
58
|
+
of the `mode`.
|
|
59
|
+
codestring (str): An [Echo Nest Musical Fingerprint
|
|
60
|
+
(ENMFP)](https://academiccommons.columbia.edu/doi/10.7916/D8Q248M4)
|
|
61
|
+
codestring for this track.
|
|
62
|
+
code_version (float): A version number for the Echo Nest Musical Fingerprint
|
|
63
|
+
format used in the codestring field.
|
|
64
|
+
echoprintstring (str): An
|
|
65
|
+
[EchoPrint](https://github.com/spotify/echoprint-codegen) codestring for
|
|
66
|
+
this track.
|
|
67
|
+
echoprint_version (float): A version number for the EchoPrint format used in
|
|
68
|
+
the echoprintstring field.
|
|
69
|
+
synchstring (str): A [Synchstring](https://github.com/echonest/synchdata) for
|
|
70
|
+
this track.
|
|
71
|
+
synch_version (float): A version number for the Synchstring used in the
|
|
72
|
+
synchstring field.
|
|
73
|
+
rhythmstring (str): A Rhythmstring for this track. The format of this string
|
|
74
|
+
is similar to the Synchstring.
|
|
75
|
+
rhythm_version (float): A version number for the Rhythmstring used in the
|
|
76
|
+
rhythmstring field.
|
|
77
|
+
|
|
78
|
+
"""
|
|
79
|
+
|
|
80
|
+
# Create a mapping from Model property names to API property names
|
|
81
|
+
_names = {
|
|
82
|
+
"num_samples": "num_samples",
|
|
83
|
+
"duration": "duration",
|
|
84
|
+
"sample_md_5": "sample_md5",
|
|
85
|
+
"offset_seconds": "offset_seconds",
|
|
86
|
+
"window_seconds": "window_seconds",
|
|
87
|
+
"analysis_sample_rate": "analysis_sample_rate",
|
|
88
|
+
"analysis_channels": "analysis_channels",
|
|
89
|
+
"end_of_fade_in": "end_of_fade_in",
|
|
90
|
+
"start_of_fade_out": "start_of_fade_out",
|
|
91
|
+
"loudness": "loudness",
|
|
92
|
+
"tempo": "tempo",
|
|
93
|
+
"tempo_confidence": "tempo_confidence",
|
|
94
|
+
"time_signature": "time_signature",
|
|
95
|
+
"time_signature_confidence": "time_signature_confidence",
|
|
96
|
+
"key": "key",
|
|
97
|
+
"key_confidence": "key_confidence",
|
|
98
|
+
"mode": "mode",
|
|
99
|
+
"mode_confidence": "mode_confidence",
|
|
100
|
+
"codestring": "codestring",
|
|
101
|
+
"code_version": "code_version",
|
|
102
|
+
"echoprintstring": "echoprintstring",
|
|
103
|
+
"echoprint_version": "echoprint_version",
|
|
104
|
+
"synchstring": "synchstring",
|
|
105
|
+
"synch_version": "synch_version",
|
|
106
|
+
"rhythmstring": "rhythmstring",
|
|
107
|
+
"rhythm_version": "rhythm_version",
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
_optionals = [
|
|
111
|
+
"num_samples",
|
|
112
|
+
"duration",
|
|
113
|
+
"sample_md_5",
|
|
114
|
+
"offset_seconds",
|
|
115
|
+
"window_seconds",
|
|
116
|
+
"analysis_sample_rate",
|
|
117
|
+
"analysis_channels",
|
|
118
|
+
"end_of_fade_in",
|
|
119
|
+
"start_of_fade_out",
|
|
120
|
+
"loudness",
|
|
121
|
+
"tempo",
|
|
122
|
+
"tempo_confidence",
|
|
123
|
+
"time_signature",
|
|
124
|
+
"time_signature_confidence",
|
|
125
|
+
"key",
|
|
126
|
+
"key_confidence",
|
|
127
|
+
"mode",
|
|
128
|
+
"mode_confidence",
|
|
129
|
+
"codestring",
|
|
130
|
+
"code_version",
|
|
131
|
+
"echoprintstring",
|
|
132
|
+
"echoprint_version",
|
|
133
|
+
"synchstring",
|
|
134
|
+
"synch_version",
|
|
135
|
+
"rhythmstring",
|
|
136
|
+
"rhythm_version",
|
|
137
|
+
]
|
|
138
|
+
|
|
139
|
+
def __init__(
|
|
140
|
+
self,
|
|
141
|
+
num_samples=APIHelper.SKIP,
|
|
142
|
+
duration=APIHelper.SKIP,
|
|
143
|
+
sample_md_5=APIHelper.SKIP,
|
|
144
|
+
offset_seconds=APIHelper.SKIP,
|
|
145
|
+
window_seconds=APIHelper.SKIP,
|
|
146
|
+
analysis_sample_rate=APIHelper.SKIP,
|
|
147
|
+
analysis_channels=APIHelper.SKIP,
|
|
148
|
+
end_of_fade_in=APIHelper.SKIP,
|
|
149
|
+
start_of_fade_out=APIHelper.SKIP,
|
|
150
|
+
loudness=APIHelper.SKIP,
|
|
151
|
+
tempo=APIHelper.SKIP,
|
|
152
|
+
tempo_confidence=APIHelper.SKIP,
|
|
153
|
+
time_signature=APIHelper.SKIP,
|
|
154
|
+
time_signature_confidence=APIHelper.SKIP,
|
|
155
|
+
key=APIHelper.SKIP,
|
|
156
|
+
key_confidence=APIHelper.SKIP,
|
|
157
|
+
mode=APIHelper.SKIP,
|
|
158
|
+
mode_confidence=APIHelper.SKIP,
|
|
159
|
+
codestring=APIHelper.SKIP,
|
|
160
|
+
code_version=APIHelper.SKIP,
|
|
161
|
+
echoprintstring=APIHelper.SKIP,
|
|
162
|
+
echoprint_version=APIHelper.SKIP,
|
|
163
|
+
synchstring=APIHelper.SKIP,
|
|
164
|
+
synch_version=APIHelper.SKIP,
|
|
165
|
+
rhythmstring=APIHelper.SKIP,
|
|
166
|
+
rhythm_version=APIHelper.SKIP):
|
|
167
|
+
"""Initialize a Track instance."""
|
|
168
|
+
# Initialize members of the class
|
|
169
|
+
if num_samples is not APIHelper.SKIP:
|
|
170
|
+
self.num_samples = num_samples
|
|
171
|
+
if duration is not APIHelper.SKIP:
|
|
172
|
+
self.duration = duration
|
|
173
|
+
if sample_md_5 is not APIHelper.SKIP:
|
|
174
|
+
self.sample_md_5 = sample_md_5
|
|
175
|
+
if offset_seconds is not APIHelper.SKIP:
|
|
176
|
+
self.offset_seconds = offset_seconds
|
|
177
|
+
if window_seconds is not APIHelper.SKIP:
|
|
178
|
+
self.window_seconds = window_seconds
|
|
179
|
+
if analysis_sample_rate is not APIHelper.SKIP:
|
|
180
|
+
self.analysis_sample_rate = analysis_sample_rate
|
|
181
|
+
if analysis_channels is not APIHelper.SKIP:
|
|
182
|
+
self.analysis_channels = analysis_channels
|
|
183
|
+
if end_of_fade_in is not APIHelper.SKIP:
|
|
184
|
+
self.end_of_fade_in = end_of_fade_in
|
|
185
|
+
if start_of_fade_out is not APIHelper.SKIP:
|
|
186
|
+
self.start_of_fade_out = start_of_fade_out
|
|
187
|
+
if loudness is not APIHelper.SKIP:
|
|
188
|
+
self.loudness = loudness
|
|
189
|
+
if tempo is not APIHelper.SKIP:
|
|
190
|
+
self.tempo = tempo
|
|
191
|
+
if tempo_confidence is not APIHelper.SKIP:
|
|
192
|
+
self.tempo_confidence = tempo_confidence
|
|
193
|
+
if time_signature is not APIHelper.SKIP:
|
|
194
|
+
self.time_signature = time_signature
|
|
195
|
+
if time_signature_confidence is not APIHelper.SKIP:
|
|
196
|
+
self.time_signature_confidence = time_signature_confidence
|
|
197
|
+
if key is not APIHelper.SKIP:
|
|
198
|
+
self.key = key
|
|
199
|
+
if key_confidence is not APIHelper.SKIP:
|
|
200
|
+
self.key_confidence = key_confidence
|
|
201
|
+
if mode is not APIHelper.SKIP:
|
|
202
|
+
self.mode = mode
|
|
203
|
+
if mode_confidence is not APIHelper.SKIP:
|
|
204
|
+
self.mode_confidence = mode_confidence
|
|
205
|
+
if codestring is not APIHelper.SKIP:
|
|
206
|
+
self.codestring = codestring
|
|
207
|
+
if code_version is not APIHelper.SKIP:
|
|
208
|
+
self.code_version = code_version
|
|
209
|
+
if echoprintstring is not APIHelper.SKIP:
|
|
210
|
+
self.echoprintstring = echoprintstring
|
|
211
|
+
if echoprint_version is not APIHelper.SKIP:
|
|
212
|
+
self.echoprint_version = echoprint_version
|
|
213
|
+
if synchstring is not APIHelper.SKIP:
|
|
214
|
+
self.synchstring = synchstring
|
|
215
|
+
if synch_version is not APIHelper.SKIP:
|
|
216
|
+
self.synch_version = synch_version
|
|
217
|
+
if rhythmstring is not APIHelper.SKIP:
|
|
218
|
+
self.rhythmstring = rhythmstring
|
|
219
|
+
if rhythm_version is not APIHelper.SKIP:
|
|
220
|
+
self.rhythm_version = rhythm_version
|
|
221
|
+
|
|
222
|
+
@classmethod
|
|
223
|
+
def from_dictionary(cls,
|
|
224
|
+
dictionary):
|
|
225
|
+
"""Create an instance of this model from a dictionary
|
|
226
|
+
|
|
227
|
+
Args:
|
|
228
|
+
dictionary (dictionary): A dictionary representation of the object
|
|
229
|
+
as obtained from the deserialization of the server's response. The
|
|
230
|
+
keys MUST match property names in the API description.
|
|
231
|
+
|
|
232
|
+
Returns:
|
|
233
|
+
object: An instance of this structure class.
|
|
234
|
+
|
|
235
|
+
"""
|
|
236
|
+
if not isinstance(dictionary, dict) or dictionary is None:
|
|
237
|
+
return None
|
|
238
|
+
|
|
239
|
+
# Extract variables from the dictionary
|
|
240
|
+
num_samples =\
|
|
241
|
+
dictionary.get("num_samples")\
|
|
242
|
+
if dictionary.get("num_samples")\
|
|
243
|
+
else APIHelper.SKIP
|
|
244
|
+
duration =\
|
|
245
|
+
dictionary.get("duration")\
|
|
246
|
+
if dictionary.get("duration")\
|
|
247
|
+
else APIHelper.SKIP
|
|
248
|
+
sample_md_5 =\
|
|
249
|
+
dictionary.get("sample_md5")\
|
|
250
|
+
if dictionary.get("sample_md5")\
|
|
251
|
+
else APIHelper.SKIP
|
|
252
|
+
offset_seconds =\
|
|
253
|
+
dictionary.get("offset_seconds")\
|
|
254
|
+
if dictionary.get("offset_seconds")\
|
|
255
|
+
else APIHelper.SKIP
|
|
256
|
+
window_seconds =\
|
|
257
|
+
dictionary.get("window_seconds")\
|
|
258
|
+
if dictionary.get("window_seconds")\
|
|
259
|
+
else APIHelper.SKIP
|
|
260
|
+
analysis_sample_rate =\
|
|
261
|
+
dictionary.get("analysis_sample_rate")\
|
|
262
|
+
if dictionary.get("analysis_sample_rate")\
|
|
263
|
+
else APIHelper.SKIP
|
|
264
|
+
analysis_channels =\
|
|
265
|
+
dictionary.get("analysis_channels")\
|
|
266
|
+
if dictionary.get("analysis_channels")\
|
|
267
|
+
else APIHelper.SKIP
|
|
268
|
+
end_of_fade_in =\
|
|
269
|
+
dictionary.get("end_of_fade_in")\
|
|
270
|
+
if dictionary.get("end_of_fade_in")\
|
|
271
|
+
else APIHelper.SKIP
|
|
272
|
+
start_of_fade_out =\
|
|
273
|
+
dictionary.get("start_of_fade_out")\
|
|
274
|
+
if dictionary.get("start_of_fade_out")\
|
|
275
|
+
else APIHelper.SKIP
|
|
276
|
+
loudness =\
|
|
277
|
+
dictionary.get("loudness")\
|
|
278
|
+
if dictionary.get("loudness")\
|
|
279
|
+
else APIHelper.SKIP
|
|
280
|
+
tempo =\
|
|
281
|
+
dictionary.get("tempo")\
|
|
282
|
+
if dictionary.get("tempo")\
|
|
283
|
+
else APIHelper.SKIP
|
|
284
|
+
tempo_confidence =\
|
|
285
|
+
dictionary.get("tempo_confidence")\
|
|
286
|
+
if dictionary.get("tempo_confidence")\
|
|
287
|
+
else APIHelper.SKIP
|
|
288
|
+
time_signature =\
|
|
289
|
+
dictionary.get("time_signature")\
|
|
290
|
+
if dictionary.get("time_signature")\
|
|
291
|
+
else APIHelper.SKIP
|
|
292
|
+
time_signature_confidence =\
|
|
293
|
+
dictionary.get("time_signature_confidence")\
|
|
294
|
+
if dictionary.get("time_signature_confidence")\
|
|
295
|
+
else APIHelper.SKIP
|
|
296
|
+
key =\
|
|
297
|
+
dictionary.get("key")\
|
|
298
|
+
if dictionary.get("key")\
|
|
299
|
+
else APIHelper.SKIP
|
|
300
|
+
key_confidence =\
|
|
301
|
+
dictionary.get("key_confidence")\
|
|
302
|
+
if dictionary.get("key_confidence")\
|
|
303
|
+
else APIHelper.SKIP
|
|
304
|
+
mode =\
|
|
305
|
+
dictionary.get("mode")\
|
|
306
|
+
if dictionary.get("mode")\
|
|
307
|
+
else APIHelper.SKIP
|
|
308
|
+
mode_confidence =\
|
|
309
|
+
dictionary.get("mode_confidence")\
|
|
310
|
+
if dictionary.get("mode_confidence")\
|
|
311
|
+
else APIHelper.SKIP
|
|
312
|
+
codestring =\
|
|
313
|
+
dictionary.get("codestring")\
|
|
314
|
+
if dictionary.get("codestring")\
|
|
315
|
+
else APIHelper.SKIP
|
|
316
|
+
code_version =\
|
|
317
|
+
dictionary.get("code_version")\
|
|
318
|
+
if dictionary.get("code_version")\
|
|
319
|
+
else APIHelper.SKIP
|
|
320
|
+
echoprintstring =\
|
|
321
|
+
dictionary.get("echoprintstring")\
|
|
322
|
+
if dictionary.get("echoprintstring")\
|
|
323
|
+
else APIHelper.SKIP
|
|
324
|
+
echoprint_version =\
|
|
325
|
+
dictionary.get("echoprint_version")\
|
|
326
|
+
if dictionary.get("echoprint_version")\
|
|
327
|
+
else APIHelper.SKIP
|
|
328
|
+
synchstring =\
|
|
329
|
+
dictionary.get("synchstring")\
|
|
330
|
+
if dictionary.get("synchstring")\
|
|
331
|
+
else APIHelper.SKIP
|
|
332
|
+
synch_version =\
|
|
333
|
+
dictionary.get("synch_version")\
|
|
334
|
+
if dictionary.get("synch_version")\
|
|
335
|
+
else APIHelper.SKIP
|
|
336
|
+
rhythmstring =\
|
|
337
|
+
dictionary.get("rhythmstring")\
|
|
338
|
+
if dictionary.get("rhythmstring")\
|
|
339
|
+
else APIHelper.SKIP
|
|
340
|
+
rhythm_version =\
|
|
341
|
+
dictionary.get("rhythm_version")\
|
|
342
|
+
if dictionary.get("rhythm_version")\
|
|
343
|
+
else APIHelper.SKIP
|
|
344
|
+
|
|
345
|
+
# Return an object of this model
|
|
346
|
+
return cls(num_samples,
|
|
347
|
+
duration,
|
|
348
|
+
sample_md_5,
|
|
349
|
+
offset_seconds,
|
|
350
|
+
window_seconds,
|
|
351
|
+
analysis_sample_rate,
|
|
352
|
+
analysis_channels,
|
|
353
|
+
end_of_fade_in,
|
|
354
|
+
start_of_fade_out,
|
|
355
|
+
loudness,
|
|
356
|
+
tempo,
|
|
357
|
+
tempo_confidence,
|
|
358
|
+
time_signature,
|
|
359
|
+
time_signature_confidence,
|
|
360
|
+
key,
|
|
361
|
+
key_confidence,
|
|
362
|
+
mode,
|
|
363
|
+
mode_confidence,
|
|
364
|
+
codestring,
|
|
365
|
+
code_version,
|
|
366
|
+
echoprintstring,
|
|
367
|
+
echoprint_version,
|
|
368
|
+
synchstring,
|
|
369
|
+
synch_version,
|
|
370
|
+
rhythmstring,
|
|
371
|
+
rhythm_version)
|
|
372
|
+
|
|
373
|
+
def __repr__(self):
|
|
374
|
+
"""Return a unambiguous string representation."""
|
|
375
|
+
_num_samples=(
|
|
376
|
+
self.num_samples
|
|
377
|
+
if hasattr(self, "num_samples")
|
|
378
|
+
else None
|
|
379
|
+
)
|
|
380
|
+
_duration=(
|
|
381
|
+
self.duration
|
|
382
|
+
if hasattr(self, "duration")
|
|
383
|
+
else None
|
|
384
|
+
)
|
|
385
|
+
_sample_md_5=(
|
|
386
|
+
self.sample_md_5
|
|
387
|
+
if hasattr(self, "sample_md_5")
|
|
388
|
+
else None
|
|
389
|
+
)
|
|
390
|
+
_offset_seconds=(
|
|
391
|
+
self.offset_seconds
|
|
392
|
+
if hasattr(self, "offset_seconds")
|
|
393
|
+
else None
|
|
394
|
+
)
|
|
395
|
+
_window_seconds=(
|
|
396
|
+
self.window_seconds
|
|
397
|
+
if hasattr(self, "window_seconds")
|
|
398
|
+
else None
|
|
399
|
+
)
|
|
400
|
+
_analysis_sample_rate=(
|
|
401
|
+
self.analysis_sample_rate
|
|
402
|
+
if hasattr(self, "analysis_sample_rate")
|
|
403
|
+
else None
|
|
404
|
+
)
|
|
405
|
+
_analysis_channels=(
|
|
406
|
+
self.analysis_channels
|
|
407
|
+
if hasattr(self, "analysis_channels")
|
|
408
|
+
else None
|
|
409
|
+
)
|
|
410
|
+
_end_of_fade_in=(
|
|
411
|
+
self.end_of_fade_in
|
|
412
|
+
if hasattr(self, "end_of_fade_in")
|
|
413
|
+
else None
|
|
414
|
+
)
|
|
415
|
+
_start_of_fade_out=(
|
|
416
|
+
self.start_of_fade_out
|
|
417
|
+
if hasattr(self, "start_of_fade_out")
|
|
418
|
+
else None
|
|
419
|
+
)
|
|
420
|
+
_loudness=(
|
|
421
|
+
self.loudness
|
|
422
|
+
if hasattr(self, "loudness")
|
|
423
|
+
else None
|
|
424
|
+
)
|
|
425
|
+
_tempo=(
|
|
426
|
+
self.tempo
|
|
427
|
+
if hasattr(self, "tempo")
|
|
428
|
+
else None
|
|
429
|
+
)
|
|
430
|
+
_tempo_confidence=(
|
|
431
|
+
self.tempo_confidence
|
|
432
|
+
if hasattr(self, "tempo_confidence")
|
|
433
|
+
else None
|
|
434
|
+
)
|
|
435
|
+
_time_signature=(
|
|
436
|
+
self.time_signature
|
|
437
|
+
if hasattr(self, "time_signature")
|
|
438
|
+
else None
|
|
439
|
+
)
|
|
440
|
+
_time_signature_confidence=(
|
|
441
|
+
self.time_signature_confidence
|
|
442
|
+
if hasattr(self, "time_signature_confidence")
|
|
443
|
+
else None
|
|
444
|
+
)
|
|
445
|
+
_key=(
|
|
446
|
+
self.key
|
|
447
|
+
if hasattr(self, "key")
|
|
448
|
+
else None
|
|
449
|
+
)
|
|
450
|
+
_key_confidence=(
|
|
451
|
+
self.key_confidence
|
|
452
|
+
if hasattr(self, "key_confidence")
|
|
453
|
+
else None
|
|
454
|
+
)
|
|
455
|
+
_mode=(
|
|
456
|
+
self.mode
|
|
457
|
+
if hasattr(self, "mode")
|
|
458
|
+
else None
|
|
459
|
+
)
|
|
460
|
+
_mode_confidence=(
|
|
461
|
+
self.mode_confidence
|
|
462
|
+
if hasattr(self, "mode_confidence")
|
|
463
|
+
else None
|
|
464
|
+
)
|
|
465
|
+
_codestring=(
|
|
466
|
+
self.codestring
|
|
467
|
+
if hasattr(self, "codestring")
|
|
468
|
+
else None
|
|
469
|
+
)
|
|
470
|
+
_code_version=(
|
|
471
|
+
self.code_version
|
|
472
|
+
if hasattr(self, "code_version")
|
|
473
|
+
else None
|
|
474
|
+
)
|
|
475
|
+
_echoprintstring=(
|
|
476
|
+
self.echoprintstring
|
|
477
|
+
if hasattr(self, "echoprintstring")
|
|
478
|
+
else None
|
|
479
|
+
)
|
|
480
|
+
_echoprint_version=(
|
|
481
|
+
self.echoprint_version
|
|
482
|
+
if hasattr(self, "echoprint_version")
|
|
483
|
+
else None
|
|
484
|
+
)
|
|
485
|
+
_synchstring=(
|
|
486
|
+
self.synchstring
|
|
487
|
+
if hasattr(self, "synchstring")
|
|
488
|
+
else None
|
|
489
|
+
)
|
|
490
|
+
_synch_version=(
|
|
491
|
+
self.synch_version
|
|
492
|
+
if hasattr(self, "synch_version")
|
|
493
|
+
else None
|
|
494
|
+
)
|
|
495
|
+
_rhythmstring=(
|
|
496
|
+
self.rhythmstring
|
|
497
|
+
if hasattr(self, "rhythmstring")
|
|
498
|
+
else None
|
|
499
|
+
)
|
|
500
|
+
_rhythm_version=(
|
|
501
|
+
self.rhythm_version
|
|
502
|
+
if hasattr(self, "rhythm_version")
|
|
503
|
+
else None
|
|
504
|
+
)
|
|
505
|
+
return (
|
|
506
|
+
f"{self.__class__.__name__}("
|
|
507
|
+
f"num_samples={_num_samples!r}, "
|
|
508
|
+
f"duration={_duration!r}, "
|
|
509
|
+
f"sample_md_5={_sample_md_5!r}, "
|
|
510
|
+
f"offset_seconds={_offset_seconds!r}, "
|
|
511
|
+
f"window_seconds={_window_seconds!r}, "
|
|
512
|
+
f"analysis_sample_rate={_analysis_sample_rate!r}, "
|
|
513
|
+
f"analysis_channels={_analysis_channels!r}, "
|
|
514
|
+
f"end_of_fade_in={_end_of_fade_in!r}, "
|
|
515
|
+
f"start_of_fade_out={_start_of_fade_out!r}, "
|
|
516
|
+
f"loudness={_loudness!r}, "
|
|
517
|
+
f"tempo={_tempo!r}, "
|
|
518
|
+
f"tempo_confidence={_tempo_confidence!r}, "
|
|
519
|
+
f"time_signature={_time_signature!r}, "
|
|
520
|
+
f"time_signature_confidence={_time_signature_confidence!r}, "
|
|
521
|
+
f"key={_key!r}, "
|
|
522
|
+
f"key_confidence={_key_confidence!r}, "
|
|
523
|
+
f"mode={_mode!r}, "
|
|
524
|
+
f"mode_confidence={_mode_confidence!r}, "
|
|
525
|
+
f"codestring={_codestring!r}, "
|
|
526
|
+
f"code_version={_code_version!r}, "
|
|
527
|
+
f"echoprintstring={_echoprintstring!r}, "
|
|
528
|
+
f"echoprint_version={_echoprint_version!r}, "
|
|
529
|
+
f"synchstring={_synchstring!r}, "
|
|
530
|
+
f"synch_version={_synch_version!r}, "
|
|
531
|
+
f"rhythmstring={_rhythmstring!r}, "
|
|
532
|
+
f"rhythm_version={_rhythm_version!r}, "
|
|
533
|
+
f")"
|
|
534
|
+
)
|
|
535
|
+
|
|
536
|
+
def __str__(self):
|
|
537
|
+
"""Return a human-readable string representation."""
|
|
538
|
+
_num_samples=(
|
|
539
|
+
self.num_samples
|
|
540
|
+
if hasattr(self, "num_samples")
|
|
541
|
+
else None
|
|
542
|
+
)
|
|
543
|
+
_duration=(
|
|
544
|
+
self.duration
|
|
545
|
+
if hasattr(self, "duration")
|
|
546
|
+
else None
|
|
547
|
+
)
|
|
548
|
+
_sample_md_5=(
|
|
549
|
+
self.sample_md_5
|
|
550
|
+
if hasattr(self, "sample_md_5")
|
|
551
|
+
else None
|
|
552
|
+
)
|
|
553
|
+
_offset_seconds=(
|
|
554
|
+
self.offset_seconds
|
|
555
|
+
if hasattr(self, "offset_seconds")
|
|
556
|
+
else None
|
|
557
|
+
)
|
|
558
|
+
_window_seconds=(
|
|
559
|
+
self.window_seconds
|
|
560
|
+
if hasattr(self, "window_seconds")
|
|
561
|
+
else None
|
|
562
|
+
)
|
|
563
|
+
_analysis_sample_rate=(
|
|
564
|
+
self.analysis_sample_rate
|
|
565
|
+
if hasattr(self, "analysis_sample_rate")
|
|
566
|
+
else None
|
|
567
|
+
)
|
|
568
|
+
_analysis_channels=(
|
|
569
|
+
self.analysis_channels
|
|
570
|
+
if hasattr(self, "analysis_channels")
|
|
571
|
+
else None
|
|
572
|
+
)
|
|
573
|
+
_end_of_fade_in=(
|
|
574
|
+
self.end_of_fade_in
|
|
575
|
+
if hasattr(self, "end_of_fade_in")
|
|
576
|
+
else None
|
|
577
|
+
)
|
|
578
|
+
_start_of_fade_out=(
|
|
579
|
+
self.start_of_fade_out
|
|
580
|
+
if hasattr(self, "start_of_fade_out")
|
|
581
|
+
else None
|
|
582
|
+
)
|
|
583
|
+
_loudness=(
|
|
584
|
+
self.loudness
|
|
585
|
+
if hasattr(self, "loudness")
|
|
586
|
+
else None
|
|
587
|
+
)
|
|
588
|
+
_tempo=(
|
|
589
|
+
self.tempo
|
|
590
|
+
if hasattr(self, "tempo")
|
|
591
|
+
else None
|
|
592
|
+
)
|
|
593
|
+
_tempo_confidence=(
|
|
594
|
+
self.tempo_confidence
|
|
595
|
+
if hasattr(self, "tempo_confidence")
|
|
596
|
+
else None
|
|
597
|
+
)
|
|
598
|
+
_time_signature=(
|
|
599
|
+
self.time_signature
|
|
600
|
+
if hasattr(self, "time_signature")
|
|
601
|
+
else None
|
|
602
|
+
)
|
|
603
|
+
_time_signature_confidence=(
|
|
604
|
+
self.time_signature_confidence
|
|
605
|
+
if hasattr(self, "time_signature_confidence")
|
|
606
|
+
else None
|
|
607
|
+
)
|
|
608
|
+
_key=(
|
|
609
|
+
self.key
|
|
610
|
+
if hasattr(self, "key")
|
|
611
|
+
else None
|
|
612
|
+
)
|
|
613
|
+
_key_confidence=(
|
|
614
|
+
self.key_confidence
|
|
615
|
+
if hasattr(self, "key_confidence")
|
|
616
|
+
else None
|
|
617
|
+
)
|
|
618
|
+
_mode=(
|
|
619
|
+
self.mode
|
|
620
|
+
if hasattr(self, "mode")
|
|
621
|
+
else None
|
|
622
|
+
)
|
|
623
|
+
_mode_confidence=(
|
|
624
|
+
self.mode_confidence
|
|
625
|
+
if hasattr(self, "mode_confidence")
|
|
626
|
+
else None
|
|
627
|
+
)
|
|
628
|
+
_codestring=(
|
|
629
|
+
self.codestring
|
|
630
|
+
if hasattr(self, "codestring")
|
|
631
|
+
else None
|
|
632
|
+
)
|
|
633
|
+
_code_version=(
|
|
634
|
+
self.code_version
|
|
635
|
+
if hasattr(self, "code_version")
|
|
636
|
+
else None
|
|
637
|
+
)
|
|
638
|
+
_echoprintstring=(
|
|
639
|
+
self.echoprintstring
|
|
640
|
+
if hasattr(self, "echoprintstring")
|
|
641
|
+
else None
|
|
642
|
+
)
|
|
643
|
+
_echoprint_version=(
|
|
644
|
+
self.echoprint_version
|
|
645
|
+
if hasattr(self, "echoprint_version")
|
|
646
|
+
else None
|
|
647
|
+
)
|
|
648
|
+
_synchstring=(
|
|
649
|
+
self.synchstring
|
|
650
|
+
if hasattr(self, "synchstring")
|
|
651
|
+
else None
|
|
652
|
+
)
|
|
653
|
+
_synch_version=(
|
|
654
|
+
self.synch_version
|
|
655
|
+
if hasattr(self, "synch_version")
|
|
656
|
+
else None
|
|
657
|
+
)
|
|
658
|
+
_rhythmstring=(
|
|
659
|
+
self.rhythmstring
|
|
660
|
+
if hasattr(self, "rhythmstring")
|
|
661
|
+
else None
|
|
662
|
+
)
|
|
663
|
+
_rhythm_version=(
|
|
664
|
+
self.rhythm_version
|
|
665
|
+
if hasattr(self, "rhythm_version")
|
|
666
|
+
else None
|
|
667
|
+
)
|
|
668
|
+
return (
|
|
669
|
+
f"{self.__class__.__name__}("
|
|
670
|
+
f"num_samples={_num_samples!s}, "
|
|
671
|
+
f"duration={_duration!s}, "
|
|
672
|
+
f"sample_md_5={_sample_md_5!s}, "
|
|
673
|
+
f"offset_seconds={_offset_seconds!s}, "
|
|
674
|
+
f"window_seconds={_window_seconds!s}, "
|
|
675
|
+
f"analysis_sample_rate={_analysis_sample_rate!s}, "
|
|
676
|
+
f"analysis_channels={_analysis_channels!s}, "
|
|
677
|
+
f"end_of_fade_in={_end_of_fade_in!s}, "
|
|
678
|
+
f"start_of_fade_out={_start_of_fade_out!s}, "
|
|
679
|
+
f"loudness={_loudness!s}, "
|
|
680
|
+
f"tempo={_tempo!s}, "
|
|
681
|
+
f"tempo_confidence={_tempo_confidence!s}, "
|
|
682
|
+
f"time_signature={_time_signature!s}, "
|
|
683
|
+
f"time_signature_confidence={_time_signature_confidence!s}, "
|
|
684
|
+
f"key={_key!s}, "
|
|
685
|
+
f"key_confidence={_key_confidence!s}, "
|
|
686
|
+
f"mode={_mode!s}, "
|
|
687
|
+
f"mode_confidence={_mode_confidence!s}, "
|
|
688
|
+
f"codestring={_codestring!s}, "
|
|
689
|
+
f"code_version={_code_version!s}, "
|
|
690
|
+
f"echoprintstring={_echoprintstring!s}, "
|
|
691
|
+
f"echoprint_version={_echoprint_version!s}, "
|
|
692
|
+
f"synchstring={_synchstring!s}, "
|
|
693
|
+
f"synch_version={_synch_version!s}, "
|
|
694
|
+
f"rhythmstring={_rhythmstring!s}, "
|
|
695
|
+
f"rhythm_version={_rhythm_version!s}, "
|
|
696
|
+
f")"
|
|
697
|
+
)
|