spotipie.utils

Classes

ResourceInfo(type, id[, owner_id])

Pseudo-immutable object storing type and ID of a Spotify Resource.

Functions

format_uri(obj_type, obj_id[, owner_id])

format_url(obj_type, obj_id[, owner_id])

get_default_http_adapter([adapter_class])

Returns an HTTPAdapter that can be mounted to a session in order to add automatically resend a request if it failed.

normalize_scope(scope)

rtype

Tuple[str, …]

pretty(d)

Prettify a dictionary

Data

RESOURCE_TYPES

frozenset() -> empty frozenset object frozenset(iterable) -> frozenset object

Reference

spotipie.utils.pretty(d)[source]

Prettify a dictionary

Return type

str

spotipie.utils.get_default_http_adapter(adapter_class=<class 'cachecontrol.adapter.CacheControlAdapter'>)[source]

Returns an HTTPAdapter that can be mounted to a session in order to add automatically resend a request if it failed. By default, a CacheControlAdapter is added. This adds caching to the session. Pass HttpAdapter if you don’t want caching.

class spotipie.utils.ResourceInfo(type, id, owner_id=None)[source]

Bases: object

Pseudo-immutable object storing type and ID of a Spotify Resource. The owner_id is an optional field and can be provided only for playlists: the old URIs and URLs for playlists required this field in the past. In any case,

It can be constructed from spotify URIs (strings) and URLs.

Method generated by attrs for class ResourceInfo.

staticmethod from_uri(uri)[source]
staticmethod from_url(url)[source]
staticmethod parse(uri_or_url)[source]
property url
property uri
spotipie.utils.normalize_scope(scope)[source]
Return type

Tuple[str, …]

spotipie.utils.format_uri(obj_type, obj_id, owner_id=None)[source]
spotipie.utils.format_url(obj_type, obj_id, owner_id=None)[source]