Misc
Implements all required non-items and non-playlist endpoints from the Spotify API.
Classes:
|
- class musify.libraries.remote.spotify.api.misc.SpotifyAPIMisc(authoriser, wrangler, cache=None)
Bases:
SpotifyAPIBase
Methods:
print_collection
([value, kind, limit])Pretty print collection data for displaying to the user.
get_self
([update_user_data])GET: /me
- Get API response for information on current user.query
(query, kind[, limit])GET: /search
- Query for items.- async print_collection(value=None, kind=None, limit=20)
Pretty print collection data for displaying to the user. Runs
print_item()
for each item in the collection.value
may be:A string representing a URL/URI/ID.
A remote API JSON response for a collection with a valid ID value under an
id
key.A RemoteResponse representing some remote collection of items.
- Parameters:
value (
str
|MutableMapping
[str
,Any
] |None
(default:None
)) – The value representing some remote collection. See description for allowed value types.kind (
RemoteIDType
|None
(default:None
)) – When an ID is provided, give the kind of ID this is here. If None and ID is given, user will be prompted to give the kind anyway.limit (
int
(default:20
)) – The number of results to call per request and, therefore, the number of items in each printed block.
- Return type:
None
- async get_self(update_user_data=True)
GET: /me
- Get API response for information on current user.- Parameters:
update_user_data (
bool
(default:True
)) – When True, update the_user_data
stored in this API object.- Return type:
dict
[str
,Any
]
- async query(query, kind, limit=10)
GET: /search
- Query for items. Modify result types returned with kind parameter- Parameters:
query (
str
|None
) – Search query.kind (
RemoteObjectType
) – The remote object type to search for.limit (
int
(default:10
)) – Number of results to get and return.
- Returns:
list
[dict
[str
,Any
]] – The response from the endpoint.