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,85 @@
1
+ # external package imports.
2
+
3
+ # our package imports.
4
+ from ..sautils import export
5
+ from .track import Track
6
+ from .tracksaved import TrackSaved
7
+ from .pageobject import PageObject
8
+
9
+ @export
10
+ class TrackPageSaved(PageObject):
11
+ """
12
+ Spotify Web API TrackPageSaved object.
13
+
14
+ This allows for multiple pages of `TrackSaved` objects to be navigated.
15
+ """
16
+
17
+ def __init__(self, root:dict=None) -> None:
18
+ """
19
+ Initializes a new instance of the class.
20
+
21
+ Args:
22
+ root (dict):
23
+ Spotify Web API JSON response in dictionary format, used to load object
24
+ attributes; otherwise, None to not load attributes.
25
+ """
26
+ # initialize base class.
27
+ super().__init__(root=root)
28
+
29
+ # initialize storage.
30
+ self._Items:list[TrackSaved] = []
31
+
32
+ if (root is None):
33
+
34
+ pass
35
+
36
+ else:
37
+
38
+ # process all collections and objects.
39
+ items:list = root.get('items',None)
40
+ if items is not None:
41
+ for item in items:
42
+ if item is not None:
43
+ self._Items.append(TrackSaved(root=item))
44
+
45
+
46
+ def __repr__(self) -> str:
47
+ return self.ToString()
48
+
49
+
50
+ def __str__(self) -> str:
51
+ return self.ToString()
52
+
53
+
54
+ @property
55
+ def Items(self) -> list[TrackSaved]:
56
+ """
57
+ Array of `TrackSaved` objects.
58
+ """
59
+ return self._Items
60
+
61
+
62
+ def GetTracks(self) -> list[Track]:
63
+ """
64
+ Gets a list of all tracks contained in the underlying `Items` list.
65
+
66
+ This is a convenience method so one does not have to loop through the `Items`
67
+ array of TrackSaved objects to get the list of tracks.
68
+ """
69
+ result:list[Track] = []
70
+ item:TrackSaved
71
+ for item in self._Items:
72
+ result.append(item.Track)
73
+ return result
74
+
75
+
76
+ def ToString(self, includeItems:bool=False) -> str:
77
+ """
78
+ Returns a displayable string representation of the class.
79
+
80
+ Args:
81
+ includeItems (bool):
82
+ True to include the Items collection of objects; otherwise, False
83
+ to only return base properties.
84
+ """
85
+ return 'TrackPageSaved: %s' % super().ToString(includeItems)
@@ -0,0 +1,88 @@
1
+ # external package imports.
2
+
3
+ # our package imports.
4
+ from ..sautils import export
5
+ from .tracksimplified import TrackSimplified
6
+ from .pageobject import PageObject
7
+
8
+ @export
9
+ class TrackPageSimplified(PageObject):
10
+ """
11
+ Spotify Web API SimplifiedTrackPage object.
12
+
13
+ This allows for multiple pages of `TrackSimplified` objects to be navigated.
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
+ # initialize base class.
26
+ super().__init__(root=root)
27
+
28
+ # initialize storage.
29
+ self._Items:list[TrackSimplified] = []
30
+
31
+ if (root is None):
32
+
33
+ pass
34
+
35
+ else:
36
+
37
+ # process all collections and objects.
38
+ items:list = root.get('items',None)
39
+ if items is not None:
40
+ for item in items:
41
+ if item is not None:
42
+ self._Items.append(TrackSimplified(root=item))
43
+
44
+
45
+ def __repr__(self) -> str:
46
+ return self.ToString()
47
+
48
+
49
+ def __str__(self) -> str:
50
+ return self.ToString()
51
+
52
+
53
+ @property
54
+ def Items(self) -> list[TrackSimplified]:
55
+ """
56
+ Array of `TrackSimplified` objects.
57
+ """
58
+ return self._Items
59
+
60
+
61
+ def ContainsId(self, itemId:str=False) -> bool:
62
+ """
63
+ Checks the `Items` collection to see if an item already exists with the
64
+ specified Id value.
65
+
66
+ Returns True if the itemId exists in the collection; otherwise, False.
67
+ """
68
+ result:bool = False
69
+
70
+ item:TrackSimplified
71
+ for item in self._Items:
72
+ if item.Id == itemId:
73
+ result = True
74
+ break
75
+
76
+ return result
77
+
78
+
79
+ def ToString(self, includeItems:bool=False) -> str:
80
+ """
81
+ Returns a displayable string representation of the class.
82
+
83
+ Args:
84
+ includeItems (bool):
85
+ True to include the Items collection of objects; otherwise, False
86
+ to only return base properties.
87
+ """
88
+ return 'TrackPageSimplified: %s' % super().ToString(includeItems)
@@ -0,0 +1,88 @@
1
+ # external package imports.
2
+
3
+ # our package imports.
4
+ from ..sautils import export
5
+ from .recommendationseed import RecommendationSeed
6
+ from .track import Track
7
+
8
+ @export
9
+ class TrackRecommendations:
10
+ """
11
+ Spotify Web API TrackRecommendations object.
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._Seeds:list[RecommendationSeed] = []
24
+ self._Tracks:list[Track] = []
25
+
26
+ if (root is None):
27
+
28
+ pass
29
+
30
+ else:
31
+
32
+ # process all collections and objects.
33
+ items:list = root.get('seeds', [])
34
+ if items is not None:
35
+ for item in items:
36
+ self._Seeds.append(RecommendationSeed(root=item))
37
+
38
+ items:list = root.get('tracks', [])
39
+ if items is not None:
40
+ for item in items:
41
+ self._Tracks.append(Track(root=item))
42
+
43
+
44
+ def __repr__(self) -> str:
45
+ return self.ToString()
46
+
47
+
48
+ def __str__(self) -> str:
49
+ return self.ToString()
50
+
51
+
52
+ @property
53
+ def Seeds(self) -> list[RecommendationSeed]:
54
+ """
55
+ A list of recommendation seed objects.
56
+ """
57
+ return self._Seeds
58
+
59
+
60
+ @property
61
+ def Tracks(self) -> list[Track]:
62
+ """
63
+ A list of Track objects, ordered according to the parameters supplied
64
+ to the `GetTrackRecommendations` method.
65
+ """
66
+ return self._Tracks
67
+
68
+
69
+ def ToDictionary(self) -> dict:
70
+ """
71
+ Returns a dictionary representation of the class.
72
+ """
73
+ result:dict = \
74
+ {
75
+ 'seeds': [ item.ToDictionary() for item in self._Seeds ],
76
+ 'tracks': [ item.ToDictionary() for item in self._Tracks ],
77
+ }
78
+ return result
79
+
80
+
81
+ def ToString(self) -> str:
82
+ """
83
+ Returns a displayable string representation of the class.
84
+ """
85
+ msg:str = 'TrackRecommendations:'
86
+ if self._Seeds is not None: msg = '%s\n Seeds Count=%s' % (msg, str(len(self._Seeds)))
87
+ if self._Tracks is not None: msg = '%s\n Tracks Count=%s' % (msg, str(len(self._Tracks)))
88
+ return msg
@@ -0,0 +1,99 @@
1
+ # external package imports.
2
+
3
+ # our package imports.
4
+ from ..sautils import export
5
+ from .track import Track
6
+
7
+ @export
8
+ class TrackSaved:
9
+ """
10
+ Spotify Web API SavedTrack 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._AddedAt:str = None
23
+ self._Track:Track = 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('track',None)
35
+ if item is not None:
36
+ self._Track = Track(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 track 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
+ album release), an additional field indicates the precision; see for example, release_date
55
+ in an album object.
56
+ """
57
+ return self._AddedAt
58
+
59
+
60
+ @property
61
+ def Track(self) -> Track:
62
+ """
63
+ Information about the track.
64
+ """
65
+ return self._Track
66
+
67
+
68
+ def ToDictionary(self) -> dict:
69
+ """
70
+ Returns a dictionary representation of the class.
71
+ """
72
+ track:dict = {}
73
+ if self._Track is not None:
74
+ track = self._Track.ToDictionary()
75
+
76
+ result:dict = \
77
+ {
78
+ 'added_at': self._AddedAt,
79
+ 'track': track
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 = 'TrackSaved:'
94
+ if self._AddedAt is not None: msg = '%s\n AddedAt="%s"' % (msg, str(self._AddedAt))
95
+
96
+ if (includeItems):
97
+ if self._Track is not None: msg = '%s\n %s' % (msg, str(self._Track))
98
+
99
+ return msg