cache_keys

Summary

create_key(method, url[, params, data, ...])

Create a unique cache key based on request details

encode_dict(data)

rtype

bytes

filter_ignored_params(data, ignored_params)

Remove any ignored params from an object, if it's dict-like

normalize_url_params(url[, params])

Strip off any request params manually added to URL and add to params

Module Contents

Functions for creating keys used for cache requests

create_key(method, url, params=None, data=None, json=None, headers=None, include_headers=False, ignored_params=None, **kwargs)

Create a unique cache key based on request details

Return type

str

Parameters
  • method (str) –

  • url (Union[str, yarl.URL]) –

  • params (Optional[Dict]) –

  • data (Optional[Dict]) –

  • json (Optional[Dict]) –

  • headers (Optional[Dict]) –

  • include_headers (bool) –

  • ignored_params (Optional[Iterable[str]]) –

encode_dict(data)
Return type

bytes

Parameters

data (Any) –

filter_ignored_params(data, ignored_params)

Remove any ignored params from an object, if it’s dict-like

Parameters

ignored_params (Iterable[str]) –

normalize_url_params(url, params=None)

Strip off any request params manually added to URL and add to params

Return type

Tuple[str, Dict]

Parameters

params (Optional[Dict]) –