Cache

Inheritance diagram of musify.libraries.remote.spotify.api.cache

Classes:

SpotifyRepositorySettings(name[, ...])

SpotifyPaginatedRepositorySettings(name[, ...])

class musify.libraries.remote.spotify.api.cache.SpotifyRepositorySettings(name, payload_handler=<aiorequestful.response.payload.StringPayloadHandler object>)

Bases: ResponseRepositorySettings

Attributes:

fields

The names of the fields relating to the keys extracted by get_key() in the order in which they appear from the results of this method.

Methods:

get_key(method, url, **__)

Extracts the name to assign to a cache entry in the repository from the given request kwargs.

get_name(payload)

Extracts the name to assign to a cache entry in the repository from a given response.

property fields: tuple[str, ...]

The names of the fields relating to the keys extracted by get_key() in the order in which they appear from the results of this method.

get_key(method, url, **__)

Extracts the name to assign to a cache entry in the repository from the given request kwargs.

Arguments passed through to .aiohttp.ClientSession.request. See aiohttp reference for more info on available kwargs: https://docs.aiohttp.org/en/stable/client_reference.html#aiohttp.ClientSession.request

Return type:

tuple[str | None, ...]

get_name(payload)

Extracts the name to assign to a cache entry in the repository from a given response.

Return type:

str | None

class musify.libraries.remote.spotify.api.cache.SpotifyPaginatedRepositorySettings(name, payload_handler=<aiorequestful.response.payload.StringPayloadHandler object>)

Bases: SpotifyRepositorySettings

Attributes:

fields

The names of the fields relating to the keys extracted by get_key() in the order in which they appear from the results of this method.

Methods:

get_key(method, url, **__)

Extracts the name to assign to a cache entry in the repository from the given request kwargs.

get_offset(url)

Extracts the offset for a paginated request from the given url.

get_limit(url)

Extracts the limit for a paginated request from the given url.

property fields: tuple[str, ...]

The names of the fields relating to the keys extracted by get_key() in the order in which they appear from the results of this method.

get_key(method, url, **__)

Extracts the name to assign to a cache entry in the repository from the given request kwargs.

Arguments passed through to .aiohttp.ClientSession.request. See aiohttp reference for more info on available kwargs: https://docs.aiohttp.org/en/stable/client_reference.html#aiohttp.ClientSession.request

Return type:

tuple[str | int | None, ...]

static get_offset(url)

Extracts the offset for a paginated request from the given url.

Return type:

int

static get_limit(url)

Extracts the limit for a paginated request from the given url.

Return type:

int