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.
- spotifywebapipython/__init__.py +35 -0
- spotifywebapipython/const.py +114 -0
- spotifywebapipython/docs/__init__.html +2156 -0
- spotifywebapipython/docs/codecopy.js +70 -0
- spotifywebapipython/docs/index.html +514 -0
- spotifywebapipython/docs/search.js +46 -0
- spotifywebapipython/docs/spotifywebapipython/const.html +636 -0
- spotifywebapipython/docs/spotifywebapipython/saappmessages.html +540 -0
- spotifywebapipython/docs/spotifywebapipython/sautils.html +620 -0
- spotifywebapipython/docs/spotifywebapipython/spotifyapierror.html +341 -0
- spotifywebapipython/docs/spotifywebapipython/spotifyapimessage.html +598 -0
- spotifywebapipython/docs/spotifywebapipython/spotifyauthtoken.html +612 -0
- spotifywebapipython/docs/spotifywebapipython/spotifyclient.html +16557 -0
- spotifywebapipython/docs/spotifywebapipython/spotifydiscovery.html +518 -0
- spotifywebapipython/docs/spotifywebapipython/spotifywebapiauthenticationerror.html +421 -0
- spotifywebapipython/docs/spotifywebapipython/spotifywebapierror.html +400 -0
- spotifywebapipython/docs/spotifywebapipython/spotifywebplayertoken.html +635 -0
- spotifywebapipython/docs/spotifywebapipython.ico +0 -0
- spotifywebapipython/docs/spotifywebapipython_OLD.ico +0 -0
- spotifywebapipython/models/__init__.py +121 -0
- spotifywebapipython/models/album.py +170 -0
- spotifywebapipython/models/albumpagesaved.py +85 -0
- spotifywebapipython/models/albumpagesimplified.py +88 -0
- spotifywebapipython/models/albumsaved.py +102 -0
- spotifywebapipython/models/albumsimplified.py +308 -0
- spotifywebapipython/models/artist.py +146 -0
- spotifywebapipython/models/artistinfo.py +282 -0
- spotifywebapipython/models/artistinfotourevent.py +127 -0
- spotifywebapipython/models/artistpage.py +70 -0
- spotifywebapipython/models/artistsimplified.py +163 -0
- spotifywebapipython/models/audiobook.py +87 -0
- spotifywebapipython/models/audiobookpagesimplified.py +88 -0
- spotifywebapipython/models/audiobooksimplified.py +362 -0
- spotifywebapipython/models/audiofeatures.py +333 -0
- spotifywebapipython/models/author.py +67 -0
- spotifywebapipython/models/category.py +168 -0
- spotifywebapipython/models/categorypage.py +70 -0
- spotifywebapipython/models/chapter.py +84 -0
- spotifywebapipython/models/chapterpagesimplified.py +88 -0
- spotifywebapipython/models/chaptersimplified.py +387 -0
- spotifywebapipython/models/context.py +113 -0
- spotifywebapipython/models/copyright.py +79 -0
- spotifywebapipython/models/device.py +301 -0
- spotifywebapipython/models/episode.py +84 -0
- spotifywebapipython/models/episodepagesaved.py +85 -0
- spotifywebapipython/models/episodepagesimplified.py +88 -0
- spotifywebapipython/models/episodesaved.py +99 -0
- spotifywebapipython/models/episodesimplified.py +370 -0
- spotifywebapipython/models/explicitcontent.py +80 -0
- spotifywebapipython/models/externalids.py +91 -0
- spotifywebapipython/models/externalurls.py +104 -0
- spotifywebapipython/models/followers.py +81 -0
- spotifywebapipython/models/imageobject.py +193 -0
- spotifywebapipython/models/imagevibrantcolors.py +182 -0
- spotifywebapipython/models/linkedfrom.py +165 -0
- spotifywebapipython/models/narrator.py +67 -0
- spotifywebapipython/models/owner.py +162 -0
- spotifywebapipython/models/pageobject.py +343 -0
- spotifywebapipython/models/playeractions.py +196 -0
- spotifywebapipython/models/playerlastplayedinfo.py +334 -0
- spotifywebapipython/models/playerplaystate.py +467 -0
- spotifywebapipython/models/playerqueueinfo.py +207 -0
- spotifywebapipython/models/playhistory.py +136 -0
- spotifywebapipython/models/playhistorypage.py +85 -0
- spotifywebapipython/models/playlist.py +125 -0
- spotifywebapipython/models/playlistpage.py +85 -0
- spotifywebapipython/models/playlistpagesimplified.py +107 -0
- spotifywebapipython/models/playlistsimplified.py +334 -0
- spotifywebapipython/models/playlisttrack.py +143 -0
- spotifywebapipython/models/playlisttracksummary.py +80 -0
- spotifywebapipython/models/recommendationseed.py +135 -0
- spotifywebapipython/models/restrictions.py +86 -0
- spotifywebapipython/models/resumepoint.py +79 -0
- spotifywebapipython/models/searchresponse.py +391 -0
- spotifywebapipython/models/searchresultbase.py +299 -0
- spotifywebapipython/models/show.py +87 -0
- spotifywebapipython/models/showpagesaved.py +85 -0
- spotifywebapipython/models/showpagesimplified.py +88 -0
- spotifywebapipython/models/showsaved.py +99 -0
- spotifywebapipython/models/showsimplified.py +320 -0
- spotifywebapipython/models/spotifyconnectdevice.py +321 -0
- spotifywebapipython/models/spotifyconnectdevices.py +441 -0
- spotifywebapipython/models/track.py +142 -0
- spotifywebapipython/models/trackpage.py +110 -0
- spotifywebapipython/models/trackpagesaved.py +85 -0
- spotifywebapipython/models/trackpagesimplified.py +88 -0
- spotifywebapipython/models/trackrecommendations.py +88 -0
- spotifywebapipython/models/tracksaved.py +99 -0
- spotifywebapipython/models/tracksimplified.py +398 -0
- spotifywebapipython/models/userprofile.py +184 -0
- spotifywebapipython/models/userprofilesimplified.py +206 -0
- spotifywebapipython/models/zeroconfdiscoveryresult.py +592 -0
- spotifywebapipython/models/zeroconfproperty.py +93 -0
- spotifywebapipython/oauthcli/__init__.py +7 -0
- spotifywebapipython/oauthcli/authclient.py +1229 -0
- spotifywebapipython/saappmessages.py +86 -0
- spotifywebapipython/sautils.py +285 -0
- spotifywebapipython/spotifyapierror.py +66 -0
- spotifywebapipython/spotifyapimessage.py +269 -0
- spotifywebapipython/spotifyauthtoken.py +264 -0
- spotifywebapipython/spotifyclient.py +17885 -0
- spotifywebapipython/spotifyconnect/__init__.py +19 -0
- spotifywebapipython/spotifyconnect/spotifyconnectdeviceeventargs.py +67 -0
- spotifywebapipython/spotifyconnect/spotifyconnectdirectorytask.py +2564 -0
- spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastapptask.py +467 -0
- spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastcontroller.py +701 -0
- spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastlistener.py +359 -0
- spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastmultizonelistener.py +212 -0
- spotifywebapipython/spotifyconnect/spotifyconnectzeroconfexceptions.py +20 -0
- spotifywebapipython/spotifyconnect/spotifyconnectzeroconflistener.py +335 -0
- spotifywebapipython/spotifydiscovery.py +473 -0
- spotifywebapipython/spotifymediatypes.py +53 -0
- spotifywebapipython/spotifywebapiauthenticationerror.py +122 -0
- spotifywebapipython/spotifywebapierror.py +106 -0
- spotifywebapipython/spotifywebplayertoken.py +743 -0
- spotifywebapipython/vibrant/__init__.py +17 -0
- spotifywebapipython/vibrant/generator.py +261 -0
- spotifywebapipython/vibrant/image.py +100 -0
- spotifywebapipython/vibrant/main.py +34 -0
- spotifywebapipython/vibrant/models.py +93 -0
- spotifywebapipython/vibrant/utils.py +56 -0
- spotifywebapipython/zeroconfapi/__init__.py +23 -0
- spotifywebapipython/zeroconfapi/authenticationtypes.py +38 -0
- spotifywebapipython/zeroconfapi/blobbuilder.py +370 -0
- spotifywebapipython/zeroconfapi/credentials.py +37 -0
- spotifywebapipython/zeroconfapi/cryptodiffiehellman.py +89 -0
- spotifywebapipython/zeroconfapi/helpers.py +64 -0
- spotifywebapipython/zeroconfapi/spotifyzeroconfapierror.py +108 -0
- spotifywebapipython/zeroconfapi/zeroconfconnect.py +1327 -0
- spotifywebapipython/zeroconfapi/zeroconfgetinfo.py +572 -0
- spotifywebapipython/zeroconfapi/zeroconfgetinfoalias.py +109 -0
- spotifywebapipython/zeroconfapi/zeroconfgetinfodrmmediaformat.py +90 -0
- spotifywebapipython/zeroconfapi/zeroconfresponse.py +195 -0
- spotifywebapipython-1.0.242.dist-info/LICENSE +22 -0
- spotifywebapipython-1.0.242.dist-info/METADATA +219 -0
- spotifywebapipython-1.0.242.dist-info/RECORD +138 -0
- spotifywebapipython-1.0.242.dist-info/WHEEL +5 -0
- spotifywebapipython-1.0.242.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# external package imports.
|
|
2
|
+
|
|
3
|
+
# our package imports.
|
|
4
|
+
from ..sautils import export
|
|
5
|
+
from .explicitcontent import ExplicitContent
|
|
6
|
+
from .externalurls import ExternalUrls
|
|
7
|
+
from .followers import Followers
|
|
8
|
+
from .imageobject import ImageObject
|
|
9
|
+
|
|
10
|
+
@export
|
|
11
|
+
class UserProfileSimplified:
|
|
12
|
+
"""
|
|
13
|
+
Spotify Web API User Profile object.
|
|
14
|
+
|
|
15
|
+
Information about the user from their account profile.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
def __init__(self, root:dict=None) -> None:
|
|
19
|
+
"""
|
|
20
|
+
Initializes a new instance of the class.
|
|
21
|
+
|
|
22
|
+
Args:
|
|
23
|
+
root (dict):
|
|
24
|
+
Spotify Web API JSON response in dictionary format, used to load object
|
|
25
|
+
attributes; otherwise, None to not load attributes.
|
|
26
|
+
"""
|
|
27
|
+
self._DisplayName:str = None
|
|
28
|
+
self._ExternalUrls:ExternalUrls = None
|
|
29
|
+
self._Followers:Followers = None
|
|
30
|
+
self._Href:str = None
|
|
31
|
+
self._Id:str = None
|
|
32
|
+
self._Images:list[ImageObject] = []
|
|
33
|
+
self._Type:str = None
|
|
34
|
+
self._Uri:str = None
|
|
35
|
+
|
|
36
|
+
if (root is None):
|
|
37
|
+
|
|
38
|
+
pass
|
|
39
|
+
|
|
40
|
+
else:
|
|
41
|
+
|
|
42
|
+
self._DisplayName = root.get('display_name', None)
|
|
43
|
+
self._Href = root.get('href', None)
|
|
44
|
+
self._Id = root.get('id', None)
|
|
45
|
+
self._Type = root.get('type', None)
|
|
46
|
+
self._Uri = root.get('uri', None)
|
|
47
|
+
|
|
48
|
+
# process all collections and objects.
|
|
49
|
+
item:dict = root.get('external_urls',None)
|
|
50
|
+
if item is not None:
|
|
51
|
+
self._ExternalUrls = ExternalUrls(root=item)
|
|
52
|
+
|
|
53
|
+
item:dict = root.get('followers',None)
|
|
54
|
+
if item is not None:
|
|
55
|
+
self._Followers = Followers(root=item)
|
|
56
|
+
|
|
57
|
+
items:list = root.get('images',None)
|
|
58
|
+
if items is not None:
|
|
59
|
+
for item in items:
|
|
60
|
+
self._Images.append(ImageObject(root=item))
|
|
61
|
+
|
|
62
|
+
UNKNOWN:str = 'unknown'
|
|
63
|
+
|
|
64
|
+
# post validations.
|
|
65
|
+
# this is done, as some authorization levels will not return some of these details;
|
|
66
|
+
if self._DisplayName is None or len(self._DisplayName.strip()) == 0:
|
|
67
|
+
self._DisplayName = self._Id
|
|
68
|
+
if self._Type is None or len(self._Type.strip()) == 0:
|
|
69
|
+
self._Type = 'user'
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def __repr__(self) -> str:
|
|
73
|
+
return self.ToString()
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def __str__(self) -> str:
|
|
77
|
+
return self.ToString()
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
@property
|
|
81
|
+
def DisplayName(self) -> str:
|
|
82
|
+
"""
|
|
83
|
+
The name displayed on the user's profile, or null if not available.
|
|
84
|
+
|
|
85
|
+
Example: `John S`
|
|
86
|
+
"""
|
|
87
|
+
return self._DisplayName
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
@property
|
|
91
|
+
def ExternalUrls(self) -> ExternalUrls:
|
|
92
|
+
"""
|
|
93
|
+
Known external URLs for this user.
|
|
94
|
+
"""
|
|
95
|
+
return self._ExternalUrls
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
@property
|
|
99
|
+
def Followers(self) -> Followers:
|
|
100
|
+
"""
|
|
101
|
+
Information about the followers of the user.
|
|
102
|
+
"""
|
|
103
|
+
return self._Followers
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
@property
|
|
107
|
+
def Href(self) -> str:
|
|
108
|
+
"""
|
|
109
|
+
A link to the Web API endpoint providing full details of the user.
|
|
110
|
+
"""
|
|
111
|
+
return self._Href
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
@property
|
|
115
|
+
def Id(self) -> str:
|
|
116
|
+
"""
|
|
117
|
+
The Spotify user ID for the user.
|
|
118
|
+
|
|
119
|
+
Example: `2up3OPMp9Tb4dAKM2erWXQ`
|
|
120
|
+
"""
|
|
121
|
+
return self._Id
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
@property
|
|
125
|
+
def Images(self) -> list[ImageObject]:
|
|
126
|
+
"""
|
|
127
|
+
The user's profile image.
|
|
128
|
+
"""
|
|
129
|
+
return self._Images
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
@property
|
|
133
|
+
def ImageUrl(self) -> str:
|
|
134
|
+
"""
|
|
135
|
+
Returns the highest resolution order image from the `Images` list, if images
|
|
136
|
+
are defined; otherwise, null.
|
|
137
|
+
"""
|
|
138
|
+
return ImageObject.GetImageHighestResolution(self._Images)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
@property
|
|
142
|
+
def Type(self) -> str:
|
|
143
|
+
"""
|
|
144
|
+
The object type: `user`.
|
|
145
|
+
"""
|
|
146
|
+
return self._Type
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
@property
|
|
150
|
+
def Uri(self) -> str:
|
|
151
|
+
"""
|
|
152
|
+
The Spotify URI for the user.
|
|
153
|
+
|
|
154
|
+
Example: `spotify:user:2up3OPMp9Tb4dAKM2erWXQ`
|
|
155
|
+
"""
|
|
156
|
+
return self._Uri
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def ToDictionary(self) -> dict:
|
|
160
|
+
"""
|
|
161
|
+
Returns a dictionary representation of the class.
|
|
162
|
+
"""
|
|
163
|
+
externalUrls:dict = {}
|
|
164
|
+
if self._ExternalUrls is not None:
|
|
165
|
+
externalUrls = self._ExternalUrls.ToDictionary()
|
|
166
|
+
|
|
167
|
+
followers:dict = {}
|
|
168
|
+
if self._Followers is not None:
|
|
169
|
+
followers = self._Followers.ToDictionary()
|
|
170
|
+
|
|
171
|
+
result:dict = \
|
|
172
|
+
{
|
|
173
|
+
'display_name': self._DisplayName,
|
|
174
|
+
'external_urls': externalUrls,
|
|
175
|
+
'followers': followers,
|
|
176
|
+
'href': self._Href,
|
|
177
|
+
'id': self._Id,
|
|
178
|
+
'image_url': self.ImageUrl,
|
|
179
|
+
'images': [ item.ToDictionary() for item in self._Images ],
|
|
180
|
+
'type': self._Type,
|
|
181
|
+
'uri': self._Uri,
|
|
182
|
+
}
|
|
183
|
+
return result
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
def ToString(self, includeTitle:bool=True) -> str:
|
|
187
|
+
"""
|
|
188
|
+
Returns a displayable string representation of the class.
|
|
189
|
+
|
|
190
|
+
Args:
|
|
191
|
+
includeTitle (str):
|
|
192
|
+
True to include the class name title prefix.
|
|
193
|
+
"""
|
|
194
|
+
msg:str = ''
|
|
195
|
+
if includeTitle:
|
|
196
|
+
msg = 'UserProfileSimplified:'
|
|
197
|
+
|
|
198
|
+
if self._DisplayName is not None: msg = '%s\n DisplayName="%s"' % (msg, str(self._DisplayName))
|
|
199
|
+
if self._Uri is not None: msg = '%s\n Uri="%s"' % (msg, str(self._Uri))
|
|
200
|
+
#if self._ExternalUrls is not None: msg = '%s\n %s' % (msg, str(self._ExternalUrls))
|
|
201
|
+
if self._Followers is not None: msg = '%s\n Followers Count=%s' % (msg, str(self._Followers.Total))
|
|
202
|
+
if self._Href is not None: msg = '%s\n Href="%s"' % (msg, str(self._Href))
|
|
203
|
+
if self._Id is not None: msg = '%s\n Id="%s"' % (msg, str(self._Id))
|
|
204
|
+
if self._Images is not None: msg = '%s\n Images Count=%s' % (msg, str(len(self._Images)))
|
|
205
|
+
if self._Type is not None: msg = '%s\n Type="%s"' % (msg, str(self._Type))
|
|
206
|
+
return msg
|