spotifywebapiPython 1.0.242__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.
Files changed (138) hide show
  1. spotifywebapipython/__init__.py +35 -0
  2. spotifywebapipython/const.py +114 -0
  3. spotifywebapipython/docs/__init__.html +2156 -0
  4. spotifywebapipython/docs/codecopy.js +70 -0
  5. spotifywebapipython/docs/index.html +514 -0
  6. spotifywebapipython/docs/search.js +46 -0
  7. spotifywebapipython/docs/spotifywebapipython/const.html +636 -0
  8. spotifywebapipython/docs/spotifywebapipython/saappmessages.html +540 -0
  9. spotifywebapipython/docs/spotifywebapipython/sautils.html +620 -0
  10. spotifywebapipython/docs/spotifywebapipython/spotifyapierror.html +341 -0
  11. spotifywebapipython/docs/spotifywebapipython/spotifyapimessage.html +598 -0
  12. spotifywebapipython/docs/spotifywebapipython/spotifyauthtoken.html +612 -0
  13. spotifywebapipython/docs/spotifywebapipython/spotifyclient.html +16557 -0
  14. spotifywebapipython/docs/spotifywebapipython/spotifydiscovery.html +518 -0
  15. spotifywebapipython/docs/spotifywebapipython/spotifywebapiauthenticationerror.html +421 -0
  16. spotifywebapipython/docs/spotifywebapipython/spotifywebapierror.html +400 -0
  17. spotifywebapipython/docs/spotifywebapipython/spotifywebplayertoken.html +635 -0
  18. spotifywebapipython/docs/spotifywebapipython.ico +0 -0
  19. spotifywebapipython/docs/spotifywebapipython_OLD.ico +0 -0
  20. spotifywebapipython/models/__init__.py +121 -0
  21. spotifywebapipython/models/album.py +170 -0
  22. spotifywebapipython/models/albumpagesaved.py +85 -0
  23. spotifywebapipython/models/albumpagesimplified.py +88 -0
  24. spotifywebapipython/models/albumsaved.py +102 -0
  25. spotifywebapipython/models/albumsimplified.py +308 -0
  26. spotifywebapipython/models/artist.py +146 -0
  27. spotifywebapipython/models/artistinfo.py +282 -0
  28. spotifywebapipython/models/artistinfotourevent.py +127 -0
  29. spotifywebapipython/models/artistpage.py +70 -0
  30. spotifywebapipython/models/artistsimplified.py +163 -0
  31. spotifywebapipython/models/audiobook.py +87 -0
  32. spotifywebapipython/models/audiobookpagesimplified.py +88 -0
  33. spotifywebapipython/models/audiobooksimplified.py +362 -0
  34. spotifywebapipython/models/audiofeatures.py +333 -0
  35. spotifywebapipython/models/author.py +67 -0
  36. spotifywebapipython/models/category.py +168 -0
  37. spotifywebapipython/models/categorypage.py +70 -0
  38. spotifywebapipython/models/chapter.py +84 -0
  39. spotifywebapipython/models/chapterpagesimplified.py +88 -0
  40. spotifywebapipython/models/chaptersimplified.py +387 -0
  41. spotifywebapipython/models/context.py +113 -0
  42. spotifywebapipython/models/copyright.py +79 -0
  43. spotifywebapipython/models/device.py +301 -0
  44. spotifywebapipython/models/episode.py +84 -0
  45. spotifywebapipython/models/episodepagesaved.py +85 -0
  46. spotifywebapipython/models/episodepagesimplified.py +88 -0
  47. spotifywebapipython/models/episodesaved.py +99 -0
  48. spotifywebapipython/models/episodesimplified.py +370 -0
  49. spotifywebapipython/models/explicitcontent.py +80 -0
  50. spotifywebapipython/models/externalids.py +91 -0
  51. spotifywebapipython/models/externalurls.py +104 -0
  52. spotifywebapipython/models/followers.py +81 -0
  53. spotifywebapipython/models/imageobject.py +193 -0
  54. spotifywebapipython/models/imagevibrantcolors.py +182 -0
  55. spotifywebapipython/models/linkedfrom.py +165 -0
  56. spotifywebapipython/models/narrator.py +67 -0
  57. spotifywebapipython/models/owner.py +162 -0
  58. spotifywebapipython/models/pageobject.py +343 -0
  59. spotifywebapipython/models/playeractions.py +196 -0
  60. spotifywebapipython/models/playerlastplayedinfo.py +334 -0
  61. spotifywebapipython/models/playerplaystate.py +467 -0
  62. spotifywebapipython/models/playerqueueinfo.py +207 -0
  63. spotifywebapipython/models/playhistory.py +136 -0
  64. spotifywebapipython/models/playhistorypage.py +85 -0
  65. spotifywebapipython/models/playlist.py +125 -0
  66. spotifywebapipython/models/playlistpage.py +85 -0
  67. spotifywebapipython/models/playlistpagesimplified.py +107 -0
  68. spotifywebapipython/models/playlistsimplified.py +334 -0
  69. spotifywebapipython/models/playlisttrack.py +143 -0
  70. spotifywebapipython/models/playlisttracksummary.py +80 -0
  71. spotifywebapipython/models/recommendationseed.py +135 -0
  72. spotifywebapipython/models/restrictions.py +86 -0
  73. spotifywebapipython/models/resumepoint.py +79 -0
  74. spotifywebapipython/models/searchresponse.py +391 -0
  75. spotifywebapipython/models/searchresultbase.py +299 -0
  76. spotifywebapipython/models/show.py +87 -0
  77. spotifywebapipython/models/showpagesaved.py +85 -0
  78. spotifywebapipython/models/showpagesimplified.py +88 -0
  79. spotifywebapipython/models/showsaved.py +99 -0
  80. spotifywebapipython/models/showsimplified.py +320 -0
  81. spotifywebapipython/models/spotifyconnectdevice.py +321 -0
  82. spotifywebapipython/models/spotifyconnectdevices.py +441 -0
  83. spotifywebapipython/models/track.py +142 -0
  84. spotifywebapipython/models/trackpage.py +110 -0
  85. spotifywebapipython/models/trackpagesaved.py +85 -0
  86. spotifywebapipython/models/trackpagesimplified.py +88 -0
  87. spotifywebapipython/models/trackrecommendations.py +88 -0
  88. spotifywebapipython/models/tracksaved.py +99 -0
  89. spotifywebapipython/models/tracksimplified.py +398 -0
  90. spotifywebapipython/models/userprofile.py +184 -0
  91. spotifywebapipython/models/userprofilesimplified.py +206 -0
  92. spotifywebapipython/models/zeroconfdiscoveryresult.py +592 -0
  93. spotifywebapipython/models/zeroconfproperty.py +93 -0
  94. spotifywebapipython/oauthcli/__init__.py +7 -0
  95. spotifywebapipython/oauthcli/authclient.py +1229 -0
  96. spotifywebapipython/saappmessages.py +86 -0
  97. spotifywebapipython/sautils.py +285 -0
  98. spotifywebapipython/spotifyapierror.py +66 -0
  99. spotifywebapipython/spotifyapimessage.py +269 -0
  100. spotifywebapipython/spotifyauthtoken.py +264 -0
  101. spotifywebapipython/spotifyclient.py +17885 -0
  102. spotifywebapipython/spotifyconnect/__init__.py +19 -0
  103. spotifywebapipython/spotifyconnect/spotifyconnectdeviceeventargs.py +67 -0
  104. spotifywebapipython/spotifyconnect/spotifyconnectdirectorytask.py +2564 -0
  105. spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastapptask.py +467 -0
  106. spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastcontroller.py +701 -0
  107. spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastlistener.py +359 -0
  108. spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastmultizonelistener.py +212 -0
  109. spotifywebapipython/spotifyconnect/spotifyconnectzeroconfexceptions.py +20 -0
  110. spotifywebapipython/spotifyconnect/spotifyconnectzeroconflistener.py +335 -0
  111. spotifywebapipython/spotifydiscovery.py +473 -0
  112. spotifywebapipython/spotifymediatypes.py +53 -0
  113. spotifywebapipython/spotifywebapiauthenticationerror.py +122 -0
  114. spotifywebapipython/spotifywebapierror.py +106 -0
  115. spotifywebapipython/spotifywebplayertoken.py +743 -0
  116. spotifywebapipython/vibrant/__init__.py +17 -0
  117. spotifywebapipython/vibrant/generator.py +261 -0
  118. spotifywebapipython/vibrant/image.py +100 -0
  119. spotifywebapipython/vibrant/main.py +34 -0
  120. spotifywebapipython/vibrant/models.py +93 -0
  121. spotifywebapipython/vibrant/utils.py +56 -0
  122. spotifywebapipython/zeroconfapi/__init__.py +23 -0
  123. spotifywebapipython/zeroconfapi/authenticationtypes.py +38 -0
  124. spotifywebapipython/zeroconfapi/blobbuilder.py +370 -0
  125. spotifywebapipython/zeroconfapi/credentials.py +37 -0
  126. spotifywebapipython/zeroconfapi/cryptodiffiehellman.py +89 -0
  127. spotifywebapipython/zeroconfapi/helpers.py +64 -0
  128. spotifywebapipython/zeroconfapi/spotifyzeroconfapierror.py +108 -0
  129. spotifywebapipython/zeroconfapi/zeroconfconnect.py +1327 -0
  130. spotifywebapipython/zeroconfapi/zeroconfgetinfo.py +572 -0
  131. spotifywebapipython/zeroconfapi/zeroconfgetinfoalias.py +109 -0
  132. spotifywebapipython/zeroconfapi/zeroconfgetinfodrmmediaformat.py +90 -0
  133. spotifywebapipython/zeroconfapi/zeroconfresponse.py +195 -0
  134. spotifywebapipython-1.0.242.dist-info/LICENSE +22 -0
  135. spotifywebapipython-1.0.242.dist-info/METADATA +219 -0
  136. spotifywebapipython-1.0.242.dist-info/RECORD +138 -0
  137. spotifywebapipython-1.0.242.dist-info/WHEEL +5 -0
  138. spotifywebapipython-1.0.242.dist-info/top_level.txt +1 -0
@@ -0,0 +1,99 @@
1
+ # external package imports.
2
+
3
+ # our package imports.
4
+ from ..sautils import export
5
+ from .episode import Episode
6
+
7
+ @export
8
+ class EpisodeSaved:
9
+ """
10
+ Spotify Web API SavedEpisode object.
11
+ """
12
+
13
+ def __init__(self, root:dict=None) -> None:
14
+ """
15
+ Initializes a new instance of the class.
16
+
17
+ Args:
18
+ root (dict):
19
+ Spotify Web API JSON response in dictionary format, used to load object
20
+ attributes; otherwise, None to not load attributes.
21
+ """
22
+ self._Episode:Episode = None
23
+ self._AddedAt:str = None
24
+
25
+ if (root is None):
26
+
27
+ pass
28
+
29
+ else:
30
+
31
+ self._AddedAt = root.get('added_at', None)
32
+
33
+ # process all collections and objects.
34
+ item:dict = root.get('episode',None)
35
+ if item is not None:
36
+ self._Episode = Episode(root=item)
37
+
38
+
39
+ def __repr__(self) -> str:
40
+ return self.ToString()
41
+
42
+
43
+ def __str__(self) -> str:
44
+ return self.ToString()
45
+
46
+
47
+ @property
48
+ def AddedAt(self) -> str:
49
+ """
50
+ The date and time the episode was saved.
51
+
52
+ Timestamps are returned in ISO 8601 format as Coordinated Universal Time (UTC) with a zero
53
+ offset: YYYY-MM-DDTHH:MM:SSZ. If the time is imprecise (for example, the date/time of an
54
+ episode release), an additional field indicates the precision; see for example, release_date
55
+ in an episode object.
56
+ """
57
+ return self._AddedAt
58
+
59
+
60
+ @property
61
+ def Episode(self) -> Episode:
62
+ """
63
+ Information about the episode.
64
+ """
65
+ return self._Episode
66
+
67
+
68
+ def ToDictionary(self) -> dict:
69
+ """
70
+ Returns a dictionary representation of the class.
71
+ """
72
+ episode:dict = {}
73
+ if self._Episode is not None:
74
+ episode = self._Episode.ToDictionary()
75
+
76
+ result:dict = \
77
+ {
78
+ 'added_at': self._AddedAt,
79
+ 'episode': episode
80
+ }
81
+ return result
82
+
83
+
84
+ def ToString(self, includeItems:bool=False) -> str:
85
+ """
86
+ Returns a displayable string representation of the class.
87
+
88
+ Args:
89
+ includeItems (bool):
90
+ True to include the Items collection of objects; otherwise, False
91
+ to only return base properties.
92
+ """
93
+ msg:str = 'EpisodeSaved:'
94
+ if self._AddedAt is not None: msg = '%s\n AddedAt="%s"' % (msg, str(self._AddedAt))
95
+
96
+ if (includeItems):
97
+ if self._Episode is not None: msg = '%s\n %s' % (msg, str(self._Episode))
98
+
99
+ return msg
@@ -0,0 +1,370 @@
1
+ # external package imports.
2
+
3
+ # our package imports.
4
+ from ..sautils import export
5
+ from .externalurls import ExternalUrls
6
+ from .imageobject import ImageObject
7
+ from .restrictions import Restrictions
8
+ from .resumepoint import ResumePoint
9
+
10
+ @export
11
+ class EpisodeSimplified:
12
+ """
13
+ Spotify Web API Simplified Episode object.
14
+ """
15
+
16
+ def __init__(self, root:dict=None) -> None:
17
+ """
18
+ Initializes a new instance of the class.
19
+
20
+ Args:
21
+ root (dict):
22
+ Spotify Web API JSON response in dictionary format, used to load object
23
+ attributes; otherwise, None to not load attributes.
24
+ """
25
+ self._AudioPreviewUrl:str = None
26
+ self._Description:str = None
27
+ self._DurationMS:int = None
28
+ self._Explicit:bool = None
29
+ self._ExternalUrls:ExternalUrls = None
30
+ self._Href:str = None
31
+ self._HtmlDescription:str = None
32
+ self._Id:str = None
33
+ self._Images:list[ImageObject] = []
34
+ self._IsExternallyHosted:bool = None
35
+ self._IsPlayable:bool = None
36
+ self._Languages:list[str] = []
37
+ self._Name:str = None
38
+ self._ReleaseDate:str = None
39
+ self._ReleaseDatePrecision:str = None
40
+ self._Restrictions:Restrictions = None
41
+ self._ResumePoint:ResumePoint = None
42
+ self._Type:str = None
43
+ self._Uri:str = None
44
+
45
+ if (root is None):
46
+
47
+ pass
48
+
49
+ else:
50
+
51
+ self._AudioPreviewUrl = root.get('audio_preview_url', None)
52
+ self._Description = root.get('description', None)
53
+ self._DurationMS = root.get('duration_ms', None)
54
+ self._Explicit = root.get('explicit', None)
55
+ self._Href = root.get('href', None)
56
+ self._HtmlDescription = root.get('html_description', None)
57
+ self._Id = root.get('id', None)
58
+ self._IsExternallyHosted = root.get('is_externally_hosted', None)
59
+ self._IsPlayable = root.get('is_playable', None)
60
+ self._Languages = root.get('languages', None) or []
61
+ self._Name = root.get('name', None)
62
+ self._ReleaseDate = root.get('release_date', None)
63
+ self._ReleaseDatePrecision = root.get('release_date_precision', None)
64
+ self._Type = root.get('type', None)
65
+ self._Uri = root.get('uri', None)
66
+
67
+ # process all collections and objects.
68
+ item:dict = root.get('external_urls',None)
69
+ if item is not None:
70
+ self._ExternalUrls = ExternalUrls(root=item)
71
+
72
+ items:list = root.get('images',None)
73
+ if items is not None:
74
+ for item in items:
75
+ self._Images.append(ImageObject(root=item))
76
+
77
+ item:dict = root.get('restrictions',None)
78
+ if item is not None:
79
+ self._Restrictions = Restrictions(root=item)
80
+
81
+ item:dict = root.get('resume_point',None)
82
+ if item is not None:
83
+ self._ResumePoint = ResumePoint(root=item)
84
+
85
+
86
+ def __repr__(self) -> str:
87
+ return self.ToString()
88
+
89
+
90
+ def __str__(self) -> str:
91
+ return self.ToString()
92
+
93
+
94
+ # implement sorting support.
95
+ def __eq__(self, other):
96
+ try:
97
+ return self.Name == other.Name
98
+ except Exception:
99
+ if (isinstance(self, EpisodeSimplified )) and (isinstance(other, EpisodeSimplified )):
100
+ return self.Name == other.Name
101
+ return False
102
+
103
+ def __lt__(self, other):
104
+ try:
105
+ return self.Name < other.Name
106
+ except Exception:
107
+ if (isinstance(self, EpisodeSimplified )) and (isinstance(other, EpisodeSimplified )):
108
+ return self.Name < other.Name
109
+ return False
110
+
111
+
112
+ @property
113
+ def AudioPreviewUrl(self) -> str:
114
+ """
115
+ A URL to a 30 second preview (MP3 format) of the episode, or null if not available.
116
+
117
+ Important policy note:
118
+ Spotify Audio preview clips can not be a standalone service.
119
+
120
+ Example: `https://p.scdn.co/mp3-preview/2f37da1d4221f40b9d1a98cd191f4d6f1646ad17`
121
+ """
122
+ return self._AudioPreviewUrl
123
+
124
+
125
+ @property
126
+ def Description(self) -> str:
127
+ """
128
+ A description of the episode.
129
+
130
+ HTML tags are stripped away from this field, use html_description field in case HTML tags are needed.
131
+ """
132
+ return self._Description
133
+
134
+
135
+ @property
136
+ def DurationMS(self) -> int:
137
+ """
138
+ The episode length in milliseconds.
139
+
140
+ Example: `1686230`
141
+ """
142
+ return self._DurationMS
143
+
144
+
145
+ @property
146
+ def Explicit(self) -> bool:
147
+ """
148
+ Whether or not the episode has explicit content (true = yes it does; false = no it does not OR unknown).
149
+ """
150
+ return self._Explicit
151
+
152
+
153
+ @property
154
+ def ExternalUrls(self) -> ExternalUrls:
155
+ """
156
+ Known external URLs for the episode.
157
+ """
158
+ return self._ExternalUrls
159
+
160
+
161
+ @property
162
+ def Href(self) -> str:
163
+ """
164
+ A link to the Web API endpoint providing full details of the episode.
165
+
166
+ Example: `https://api.spotify.com/v1/episodes/5Xt5DXGzch68nYYamXrNxZ`
167
+ """
168
+ return self._Href
169
+
170
+
171
+ @property
172
+ def HtmlDescription(self) -> str:
173
+ """
174
+ A description of the episode. This field may contain HTML tags.
175
+ """
176
+ return self._HtmlDescription
177
+
178
+
179
+ @property
180
+ def Id(self) -> str:
181
+ """
182
+ The Spotify ID for the episode.
183
+
184
+ Example: `5Xt5DXGzch68nYYamXrNxZ`
185
+ """
186
+ return self._Id
187
+
188
+
189
+ @property
190
+ def Images(self) -> list[ImageObject]:
191
+ """
192
+ The cover art for the episode in various sizes, widest first.
193
+ """
194
+ return self._Images
195
+
196
+
197
+ @property
198
+ def ImageUrl(self) -> str:
199
+ """
200
+ Returns the highest resolution order image from the `Images` list, if images
201
+ are defined; otherwise, null.
202
+ """
203
+ return ImageObject.GetImageHighestResolution(self._Images)
204
+
205
+
206
+ @property
207
+ def IsExternallyHosted(self) -> bool:
208
+ """
209
+ True if the episode is hosted outside of Spotify's CDN.
210
+ """
211
+ return self._IsExternallyHosted
212
+
213
+
214
+ @property
215
+ def IsPlayable(self) -> bool:
216
+ """
217
+ True if the episode is playable in the given market. Otherwise false.
218
+ """
219
+ return self._IsPlayable
220
+
221
+
222
+ @property
223
+ def Languages(self) -> list[str]:
224
+ """
225
+ A list of the languages used in the episode, identified by their ISO 639-1 code.
226
+
227
+ Example: `[fr,en]`
228
+ """
229
+ return self._Languages
230
+
231
+
232
+ @property
233
+ def Name(self) -> str:
234
+ """
235
+ The name of the episode.
236
+ """
237
+ return self._Name
238
+
239
+
240
+ @property
241
+ def ReleaseDate(self) -> str:
242
+ """
243
+ The date the episode was first released.
244
+
245
+ Example: `1981-12`
246
+ Depending on the precision, it might be shown as "1981" or "1981-12".
247
+ """
248
+ return self._ReleaseDate
249
+
250
+
251
+ @property
252
+ def ReleaseDatePrecision(self) -> str:
253
+ """
254
+ The precision with which release_date value is known.
255
+ Allowed values: `year`, `month`, `day`.
256
+
257
+ Example: `year`
258
+ """
259
+ return self._ReleaseDatePrecision
260
+
261
+
262
+ @property
263
+ def Restrictions(self) -> Restrictions:
264
+ """
265
+ Included in the response when a content restriction is applied.
266
+ """
267
+ return self._Restrictions
268
+
269
+
270
+ @property
271
+ def ResumePoint(self) -> ResumePoint:
272
+ """
273
+ The user's most recent position in the episode.
274
+ Set if the supplied access token is a user token and has the scope 'user-read-playback-position'.
275
+ """
276
+ return self._ResumePoint
277
+
278
+
279
+ @property
280
+ def Type(self) -> str:
281
+ """
282
+ The object type: `episode`.
283
+ """
284
+ return self._Type
285
+
286
+
287
+ @property
288
+ def Uri(self) -> str:
289
+ """
290
+ The Spotify URI for the episode.
291
+
292
+ Example: `spotify:episode:0zLhl3WsOCQHbe1BPTiHgr`
293
+ """
294
+ return self._Uri
295
+
296
+
297
+ def ToDictionary(self) -> dict:
298
+ """
299
+ Returns a dictionary representation of the class.
300
+ """
301
+ externalUrls:dict = {}
302
+ if self._ExternalUrls is not None:
303
+ externalUrls = self._ExternalUrls.ToDictionary()
304
+
305
+ restrictions:dict = {}
306
+ if self._Restrictions is not None:
307
+ restrictions = self._Restrictions.ToDictionary()
308
+
309
+ resumePoint:dict = {}
310
+ if self._ResumePoint is not None:
311
+ resumePoint = self._ResumePoint.ToDictionary()
312
+
313
+ result:dict = \
314
+ {
315
+ 'audio_preview_url': self._AudioPreviewUrl,
316
+ 'description': self._Description,
317
+ 'duration_ms': self._DurationMS,
318
+ 'explicit': self._Explicit,
319
+ 'external_urls': externalUrls,
320
+ 'href': self._Href,
321
+ 'html_description': self._HtmlDescription,
322
+ 'id': self._Id,
323
+ 'image_url': self.ImageUrl,
324
+ 'images': [ item.ToDictionary() for item in self._Images ],
325
+ 'is_externally_hosted': self._IsExternallyHosted,
326
+ 'is_playable': self._IsPlayable,
327
+ 'languages': [ item for item in self._Languages ],
328
+ 'name': self._Name,
329
+ 'release_date': self._ReleaseDate,
330
+ 'release_date_precision': self._ReleaseDatePrecision,
331
+ 'restrictions': restrictions,
332
+ 'resume_point': resumePoint,
333
+ 'type': self._Type,
334
+ 'uri': self._Uri,
335
+ }
336
+ return result
337
+
338
+
339
+ def ToString(self, includeTitle:bool=True) -> str:
340
+ """
341
+ Returns a displayable string representation of the class.
342
+
343
+ Args:
344
+ includeTitle (str):
345
+ True to include the class name title prefix.
346
+ """
347
+ msg:str = ''
348
+ if includeTitle:
349
+ msg = 'EpisodeSimplified:'
350
+
351
+ if self._Name is not None: msg = '%s\n Name="%s"' % (msg, str(self._Name))
352
+ if self._Uri is not None: msg = '%s\n Uri="%s"' % (msg, str(self._Uri))
353
+ if self._AudioPreviewUrl is not None: msg = '%s\n AudioPreviewUrl="%s"' % (msg, str(self._AudioPreviewUrl))
354
+ if self._Description is not None: msg = '%s\n Description="%s"' % (msg, str(self._Description))
355
+ if self._DurationMS is not None: msg = '%s\n DurationMS="%s"' % (msg, str(self._DurationMS))
356
+ if self._Explicit is not None: msg = '%s\n Explicit="%s"' % (msg, str(self._Explicit))
357
+ #if self._ExternalUrls is not None: msg = '%s\n %s' % (msg, str(self._ExternalUrls))
358
+ if self._Href is not None: msg = '%s\n Href="%s"' % (msg, str(self._Href))
359
+ if self._HtmlDescription is not None: msg = '%s\n HtmlDescription="%s"' % (msg, str(self._HtmlDescription))
360
+ if self._Id is not None: msg = '%s\n Id="%s"' % (msg, str(self._Id))
361
+ if self._Images is not None: msg = '%s\n Images Count=%s' % (msg, str(len(self._Images)))
362
+ if self._IsExternallyHosted is not None: msg = '%s\n IsExternallyHosted="%s"' % (msg, str(self._IsExternallyHosted))
363
+ if self._IsPlayable is not None: msg = '%s\n IsPlayable="%s"' % (msg, str(self._IsPlayable))
364
+ if self._Languages is not None: msg = '%s\n Languages Count=%s' % (msg, str(len(self._Languages)))
365
+ if self._ReleaseDate is not None: msg = '%s\n ReleaseDate="%s"' % (msg, str(self._ReleaseDate))
366
+ if self._ReleaseDatePrecision is not None: msg = '%s\n ReleaseDatePrecision="%s"' % (msg, str(self._ReleaseDatePrecision))
367
+ if self._Restrictions is not None: msg = '%s\n %s' % (msg, str(self._Restrictions))
368
+ if self._ResumePoint is not None: msg = '%s\n %s' % (msg, str(self._ResumePoint))
369
+ if self._Type is not None: msg = '%s\n Type="%s"' % (msg, str(self._Type))
370
+ return msg
@@ -0,0 +1,80 @@
1
+ # external package imports.
2
+
3
+ # our package imports.
4
+ from ..sautils import export
5
+
6
+ @export
7
+ class ExplicitContent:
8
+ """
9
+ Spotify Web API Explicit Content object.
10
+
11
+ Contains information about explicit content settings.
12
+ """
13
+
14
+ def __init__(self, root:dict=None) -> None:
15
+ """
16
+ Initializes a new instance of the class.
17
+
18
+ Args:
19
+ root (dict):
20
+ Spotify Web API JSON response in dictionary format, used to load object
21
+ attributes; otherwise, None to not load attributes.
22
+ """
23
+ self._FilterEnabled:bool = None
24
+ self._FilterLocked:bool = None
25
+
26
+ if (root is None):
27
+
28
+ pass
29
+
30
+ else:
31
+
32
+ self._FilterEnabled = root.get('filter_enabled', None)
33
+ self._FilterLocked = root.get('filter_locked', None)
34
+
35
+
36
+ def __repr__(self) -> str:
37
+ return self.ToString()
38
+
39
+
40
+ def __str__(self) -> str:
41
+ return self.ToString()
42
+
43
+
44
+ @property
45
+ def FilterEnabled(self) -> bool:
46
+ """
47
+ When true, indicates that explicit content should not be played.
48
+ """
49
+ return self._FilterEnabled
50
+
51
+
52
+ @property
53
+ def FilterLocked(self) -> bool:
54
+ """
55
+ When true, indicates that the explicit content setting is locked and
56
+ can't be changed by the user.
57
+ """
58
+ return self._FilterLocked
59
+
60
+
61
+ def ToDictionary(self) -> dict:
62
+ """
63
+ Returns a dictionary representation of the class.
64
+ """
65
+ result:dict = \
66
+ {
67
+ 'filter_enabled': self._FilterEnabled,
68
+ 'filter_locked': self._FilterLocked,
69
+ }
70
+ return result
71
+
72
+
73
+ def ToString(self) -> str:
74
+ """
75
+ Returns a displayable string representation of the class.
76
+ """
77
+ msg:str = 'ExplicitContent:'
78
+ if self._FilterEnabled is not None: msg = '%s\n FilterEnabled="%s"' % (msg, str(self._FilterEnabled))
79
+ if self._FilterLocked is not None: msg = '%s\n FilterLocked=%s' % (msg, str(self._FilterLocked))
80
+ return msg
@@ -0,0 +1,91 @@
1
+ # external package imports.
2
+
3
+ # our package imports.
4
+ from ..sautils import export
5
+
6
+ @export
7
+ class ExternalIds:
8
+ """
9
+ Spotify Web API ExternalIds object.
10
+
11
+ Contains known external ID's for various object types: artist, track, etc.
12
+ """
13
+
14
+ def __init__(self, root:dict=None) -> None:
15
+ """
16
+ Initializes a new instance of the class.
17
+
18
+ Args:
19
+ root (dict):
20
+ Spotify Web API JSON response in dictionary format, used to load object
21
+ attributes; otherwise, None to not load attributes.
22
+ """
23
+ self._Ean:str = None
24
+ self._Isrc:str = None
25
+ self._Upc:str = None
26
+
27
+ if (root is None):
28
+
29
+ pass
30
+
31
+ else:
32
+
33
+ self._Ean = root.get('ean', None)
34
+ self._Isrc = root.get('isrc', None)
35
+ self._Upc = root.get('upc', None)
36
+
37
+
38
+ def __repr__(self) -> str:
39
+ return self.ToString()
40
+
41
+
42
+ def __str__(self) -> str:
43
+ return self.ToString()
44
+
45
+
46
+ @property
47
+ def Ean(self) -> str:
48
+ """
49
+ International Article Number.
50
+ """
51
+ return self._Ean
52
+
53
+
54
+ @property
55
+ def Isrc(self) -> str:
56
+ """
57
+ International Standard Recording Code.
58
+ """
59
+ return self._Isrc
60
+
61
+
62
+ @property
63
+ def Upc(self) -> str:
64
+ """
65
+ Universal Product Code.
66
+ """
67
+ return self._Upc
68
+
69
+
70
+ def ToDictionary(self) -> dict:
71
+ """
72
+ Returns a dictionary representation of the class.
73
+ """
74
+ result:dict = \
75
+ {
76
+ 'ean': self._Ean,
77
+ 'isrc': self._Isrc,
78
+ 'upc': self._Upc,
79
+ }
80
+ return result
81
+
82
+
83
+ def ToString(self) -> str:
84
+ """
85
+ Returns a displayable string representation of the class.
86
+ """
87
+ msg:str = 'ExternalIds:'
88
+ if self._Ean is not None: msg = '%s\n Ean="%s"' % (msg, str(self._Ean))
89
+ if self._Isrc is not None: msg = '%s\n Isrc="%s"' % (msg, str(self._Isrc))
90
+ if self._Upc is not None: msg = '%s\n Upc="%s"' % (msg, str(self._Upc))
91
+ return msg