MCPcopy Create free account
hub / github.com/requests-cache/requests-cache / sorted

Method sorted

requests_cache/backends/sqlite.py:175–190  ·  view source on GitHub ↗

Get cached responses, with sorting and other query options. Args: key: Key to sort by; either 'expires', 'size', or 'key' reversed: Sort in descending order limit: Maximum number of responses to return expired: Set to ``False`` to exclude expi

(
        self,
        key: str = 'expires',
        reversed: bool = False,
        limit: Optional[int] = None,
        expired: bool = True,
    )

Source from the content-addressed store, hash-verified

173 super().recreate_keys()
174
175 def sorted(
176 self,
177 key: str = 'expires',
178 reversed: bool = False,
179 limit: Optional[int] = None,
180 expired: bool = True,
181 ) -> Iterator[CachedResponse]:
182 """Get cached responses, with sorting and other query options.
183
184 Args:
185 key: Key to sort by; either 'expires', 'size', or 'key'
186 reversed: Sort in descending order
187 limit: Maximum number of responses to return
188 expired: Set to ``False`` to exclude expired responses
189 """
190 return self.responses.sorted(key, reversed, limit, expired)
191
192
193class SQLiteDict(BaseStorage):

Callers

nothing calls this directly

Calls 1

sortedMethod · 0.45

Tested by

no test coverage detected