@@ -550,8 +550,8 @@ def request( # noqa: PLR0913, C901
550550 method : str ,
551551 path : str ,
552552 * ,
553- use_cache : bool = False ,
554- reset_cache : bool = False ,
553+ enable_cache : bool = False ,
554+ refresh_cache : bool = False ,
555555 use_api_key : bool = False ,
556556 md5_checksum : str | None = None ,
557557 ** request_kwargs : Any ,
@@ -565,10 +565,11 @@ def request( # noqa: PLR0913, C901
565565 HTTP method to use.
566566 path : str
567567 API path relative to the base URL.
568- use_cache : bool, optional
569- Whether to load/store responses from cache.
570- reset_cache : bool, optional
571- If True, bypass existing cache entries.
568+ enable_cache : bool, optional
569+ Whether to load/store response from cache.
570+ refresh_cache : bool, optional
571+ Only used when `enable_cache=True`. If True, ignore any existing
572+ cached response and overwrite it with a fresh one.
572573 use_api_key : bool, optional
573574 Whether to include the API key in query parameters.
574575 md5_checksum : str or None, optional
@@ -607,7 +608,7 @@ def request( # noqa: PLR0913, C901
607608
608609 files = request_kwargs .pop ("files" , None )
609610
610- if use_cache and not reset_cache :
611+ if enable_cache and not refresh_cache :
611612 cache_key = self .cache .get_key (url , params )
612613 try :
613614 return self .cache .load (cache_key )
@@ -646,7 +647,7 @@ def request( # noqa: PLR0913, C901
646647 if md5_checksum is not None :
647648 self ._verify_checksum (response , md5_checksum )
648649
649- if use_cache :
650+ if enable_cache :
650651 cache_key = self .cache .get_key (url , params )
651652 self .cache .save (cache_key , response )
652653
@@ -680,8 +681,8 @@ def get(
680681 self ,
681682 path : str ,
682683 * ,
683- use_cache : bool = False ,
684- reset_cache : bool = False ,
684+ enable_cache : bool = False ,
685+ refresh_cache : bool = False ,
685686 use_api_key : bool = False ,
686687 md5_checksum : str | None = None ,
687688 ** request_kwargs : Any ,
@@ -693,9 +694,9 @@ def get(
693694 ----------
694695 path : str
695696 API path relative to the base URL.
696- use_cache : bool, optional
697+ enable_cache : bool, optional
697698 Whether to use the response cache.
698- reset_cache : bool, optional
699+ refresh_cache : bool, optional
699700 Whether to ignore existing cached entries.
700701 use_api_key : bool, optional
701702 Whether to include the API key.
@@ -712,8 +713,8 @@ def get(
712713 return self .request (
713714 method = "GET" ,
714715 path = path ,
715- use_cache = use_cache ,
716- reset_cache = reset_cache ,
716+ enable_cache = enable_cache ,
717+ refresh_cache = refresh_cache ,
717718 use_api_key = use_api_key ,
718719 md5_checksum = md5_checksum ,
719720 ** request_kwargs ,
@@ -746,7 +747,7 @@ def post(
746747 return self .request (
747748 method = "POST" ,
748749 path = path ,
749- use_cache = False ,
750+ enable_cache = False ,
750751 use_api_key = use_api_key ,
751752 ** request_kwargs ,
752753 )
@@ -774,7 +775,7 @@ def delete(
774775 return self .request (
775776 method = "DELETE" ,
776777 path = path ,
777- use_cache = False ,
778+ enable_cache = False ,
778779 use_api_key = True ,
779780 ** request_kwargs ,
780781 )
0 commit comments