Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/requests-cache/requests-cache
/ functions
Functions
788 in github.com/requests-cache/requests-cache
⨍
Functions
788
◇
Types & classes
66
↳
Endpoints
31
↓ 3 callers
Function
uninstall_cache
Disable the cache by restoring the original :py:class:`requests.Session`
requests_cache/patcher.py:56
↓ 3 callers
Method
update_revalidated_response
After revalidation, update the cached response's expiration and headers
requests_cache/policy/actions.py:258
↓ 2 callers
Method
__delitem__
(self, key)
requests_cache/backends/filesystem.py:395
↓ 2 callers
Method
__init__
( self, namespace: str, collection_name: Optional[str] = None, connection=None
requests_cache/backends/redis.py:60
↓ 2 callers
Method
__rich_repr__
(self)
requests_cache/models/base.py:18
↓ 2 callers
Method
_convert_redirects
Convert redirect history, if any; avoid recursion by not copying redirects of redirects
requests_cache/models/response.py:119
↓ 2 callers
Method
_create_table
Create a default table if one does not already exist
requests_cache/backends/dynamodb.py:95
↓ 2 callers
Method
_enable_ttl
Enable TTL, if not already enabled
requests_cache/backends/dynamodb.py:114
↓ 2 callers
Method
_evict
Make space in the cache to fit the given number of bytes, if needed. This starts deleting the least recently used entries first.
requests_cache/backends/filesystem.py:273
↓ 2 callers
Function
_format
(unit)
requests_cache/models/response.py:212
↓ 2 callers
Function
_is_method_allowed
Check request method as well as method override headers
requests_cache/policy/actions.py:405
↓ 2 callers
Function
_log_cache_criteria
Log details on any failed checks for cache read or write
requests_cache/policy/actions.py:427
↓ 2 callers
Function
_to_multidict
(d)
examples/vcr.py:57
↓ 2 callers
Method
bulk_delete
Delete multiple keys from the cache, without raising errors for missing keys. This is a naive, generic implementation that subclasses should
requests_cache/backends/base.py:332
↓ 2 callers
Function
coalesce
Get the first non-``None`` value in a list of values
requests_cache/_utils.py:23
↓ 2 callers
Method
copy
Create a copy of this pipeline and its stage objects
requests_cache/serializers/pipeline.py:57
↓ 2 callers
Method
count_request
(self)
examples/rps_graph.py:38
↓ 2 callers
Method
delete
(self, *args, **kwargs)
requests_cache/backends/gridfs.py:55
↓ 2 callers
Method
deserialize
Handle Binary objects from a custom serializer
requests_cache/backends/dynamodb.py:178
↓ 2 callers
Method
dumps
(self, *args, **kwargs)
requests_cache/_utils.py:60
↓ 2 callers
Method
dumps
(self, value)
requests_cache/serializers/cattrs.py:85
↓ 2 callers
Function
filter_sort_json
(data: Union[List, Mapping], ignored_parameters: ParamList)
requests_cache/cache_keys.py:254
↓ 2 callers
Function
format_datetime
Get a formatted datetime string in the local time zone
requests_cache/models/response.py:201
↓ 2 callers
Method
from_request
Create a CachedRequest based on an original request object
requests_cache/models/request.py:26
↓ 2 callers
Function
get_cache_path
Get a resolved cache path
requests_cache/backends/sqlite.py:481
↓ 2 callers
Function
get_randomized_response
Get a response with randomized content
examples/benchmark.py:75
↓ 2 callers
Function
get_user_info
Display some info about your own resources on GitHub
examples/pygithub.py:50
↓ 2 callers
Method
head
(self, url: str, **kwargs)
requests_cache/session.py:139
↓ 2 callers
Function
init_backend
Initialize a backend from a name, class, or instance
requests_cache/backends/__init__.py:63
↓ 2 callers
Method
init_cache
(self, index=0, clear=True, **kwargs)
tests/integration/test_filesystem.py:46
↓ 2 callers
Method
items
Get all ``(key, value)`` pairs in the hash
requests_cache/backends/redis.py:191
↓ 2 callers
Method
loads
(self, value)
tests/integration/test_sqlite.py:295
↓ 2 callers
Method
next_interval
Create a new task to draw the next line on the bar chart
examples/rps_graph.py:33
↓ 2 callers
Function
normalize_body
Normalize and filter a request body if possible, depending on Content-Type
requests_cache/cache_keys.py:168
↓ 2 callers
Function
normalize_params
Normalize and filter urlencoded params from either a URL or request body with form data
requests_cache/cache_keys.py:223
↓ 2 callers
Method
options
(self, url: str, **kwargs)
requests_cache/session.py:135
↓ 2 callers
Method
patch
(self, url: str, data=None, **kwargs)
requests_cache/session.py:149
↓ 2 callers
Function
patch_form_boundary
If the ``files`` param is present, patch the form boundary used to separate multipart uploads. ``requests`` does not provide a way to pass a custo
requests_cache/_utils.py:78
↓ 2 callers
Function
redact_response
Redact any ignored parameters (potentially containing sensitive info) from a cached request
requests_cache/cache_keys.py:239
↓ 2 callers
Method
remove_expired_responses
(self, expire_after: ExpirationTime = None)
requests_cache/backends/base.py:261
↓ 2 callers
Function
send_requests
()
examples/threads.py:21
↓ 2 callers
Function
send_requests
()
examples/url_patterns.py:24
↓ 2 callers
Function
to_vcr_cassette_dict
Convert responses to a VCR cassette dict
examples/vcr.py:44
↓ 2 callers
Method
write
(i)
tests/integration/base_storage_test.py:184
↓ 2 callers
Function
write_cassette
(cassette, path)
examples/vcr.py:87
↓ 1 callers
Method
__getitem__
(self, key)
requests_cache/backends/filesystem.py:401
↓ 1 callers
Method
__init__
(self, cache_name: str = DEFAULT_CACHE_NAME, **kwargs)
requests_cache/backends/base.py:54
↓ 1 callers
Method
__init__
( self, db_name, collection_name=None, connection=None, serializer: Op
requests_cache/backends/gridfs.py:70
↓ 1 callers
Method
__init__
( self, table_name: str, create_table: bool = True, ttl: bool = True,
requests_cache/backends/dynamodb.py:72
↓ 1 callers
Method
__init__
( self, db_name: str, collection_name: str = 'http_cache', connection: Optiona
requests_cache/backends/mongodb.py:83
↓ 1 callers
Method
__init__
( self, db_path: StrOrPath, table_name: str = 'http_cache', busy_timeout: Opti
requests_cache/backends/sqlite.py:196
↓ 1 callers
Method
__setitem__
Save a value (file size), and update access time and total cache size
requests_cache/backends/filesystem.py:410
↓ 1 callers
Method
_bkeys
(self, keys: Iterable[str])
requests_cache/backends/redis.py:80
↓ 1 callers
Method
_cookies_match
Compare cookies between the current request and cached request for Vary: Cookie
requests_cache/policy/actions.py:383
↓ 1 callers
Function
_copy_body
Read and copy raw response data, and then restore response object to its previous state. This is necessary so streaming responses behave consisten
requests_cache/models/raw_response.py:118
↓ 1 callers
Function
_decode_content
Decode response body into a human-readable format, if possible
requests_cache/serializers/cattrs.py:180
↓ 1 callers
Method
_delete_expired
A more efficient implementation of deleting expired responses in SQL
requests_cache/backends/sqlite.py:126
↓ 1 callers
Function
_encode_content
Re-encode response body if saved as JSON or text (via ``decode_content=True``). This has no effect for a binary response body.
requests_cache/serializers/cattrs.py:201
↓ 1 callers
Method
_estimate_size
Estimate the current size of the database based on page count * size
requests_cache/backends/sqlite.py:408
↓ 1 callers
Function
_expires_str
(response)
examples/url_patterns.py:33
↓ 1 callers
Function
_float_to_decimal
(value: DecodedContent)
requests_cache/serializers/cattrs.py:231
↓ 1 callers
Function
_format_sequence
Get SQL parameter marks for a sequence-based query
requests_cache/backends/sqlite.py:459
↓ 1 callers
Function
_get_extension
Use either the provided file extension, or get the serializer's default extension
requests_cache/backends/filesystem.py:494
↓ 1 callers
Function
_get_sqlite_cache_path
Get a resolved path for a SQLite database file (or memory URI)
requests_cache/backends/sqlite.py:464
↓ 1 callers
Method
_handle_error
Handle a request error based on settings: * Default behavior: re-raise the error * stale-if-error: Ignore the error and and return the
requests_cache/session.py:327
↓ 1 callers
Function
_log_vary_diff
Log which specific headers specified by Vary did not match
requests_cache/policy/actions.py:413
↓ 1 callers
Method
_merge_match_headers
Merge Vary headers with user-configured match_headers to build a complete set of headers for the secondary cache key.
requests_cache/policy/actions.py:394
↓ 1 callers
Function
_parse_http_date
Attempt to parse an HTTP (RFC 5322-compatible) timestamp
requests_cache/policy/expiration.py:94
↓ 1 callers
Method
_prune_redirects
Remove any redirects that no longer point to an existing response
requests_cache/backends/base.py:206
↓ 1 callers
Method
_prune_redirects
A more efficient implementation of removing invalid redirects in SQL
requests_cache/backends/sqlite.py:134
↓ 1 callers
Method
_rename_kwargs
(kwargs)
requests_cache/policy/settings.py:65
↓ 1 callers
Method
_resend
Handle a stale cached response by attempting to resend the request and cache a fresh response
requests_cache/session.py:299
↓ 1 callers
Method
_resend_async
Send a non-blocking request to refresh a cached response
requests_cache/session.py:321
↓ 1 callers
Method
_set_ttl
(self, ttl: int, overwrite: bool = False)
requests_cache/backends/mongodb.py:110
↓ 1 callers
Function
_split_kv_directive
Split a cache directive into a `(key, value)` pair, or `(key, True)` if value-only
requests_cache/policy/directives.py:63
↓ 1 callers
Method
_sync_lru_index
Rebuild the LRU index from files on disk
requests_cache/backends/filesystem.py:291
↓ 1 callers
Method
_update_from_response_headers
Check response headers for expiration and other cache directives
requests_cache/policy/actions.py:290
↓ 1 callers
Method
_update_validation_headers
If needed, get validation headers based on a cached response. Revalidation may be triggered by a stale response, request headers, or cached re
requests_cache/policy/actions.py:305
↓ 1 callers
Function
_url_match
Determine if a URL matches a pattern Args: url: URL to test. Its base URL (without protocol) will be used. pattern: Glob pattern
requests_cache/policy/expiration.py:105
↓ 1 callers
Method
_validate_vary
If the cached response contains Vary, check that the specified request headers match
requests_cache/policy/actions.py:328
↓ 1 callers
Method
_write
(self, key, value)
requests_cache/backends/sqlite.py:343
↓ 1 callers
Function
assert_delta_approx_equal
Assert that the given datetimes are approximately ``target_delta`` seconds apart
tests/conftest.py:291
↓ 1 callers
Method
bulk_delete
Delete multiple keys from the cache. Does not raise errors for missing keys.
requests_cache/backends/dynamodb.py:169
↓ 1 callers
Method
bulk_delete
Delete multiple items from the cache, without raising errors for any missing items. Supports deleting by either key or by value.
requests_cache/backends/sqlite.py:361
↓ 1 callers
Function
check_cache
Check some information on cached requests
examples/pygithub.py:88
↓ 1 callers
Function
chunkify
Split an iterable into chunks of a max size
requests_cache/_utils.py:16
↓ 1 callers
Function
clean
Clean up temporary build + documentation files
noxfile.py:89
↓ 1 callers
Method
clear
(self)
requests_cache/backends/sqlite.py:376
↓ 1 callers
Function
convert_cache
(*args, **kwargs)
examples/convert_cache.py:31
↓ 1 callers
Function
convert_old_response
(cached_response, timestamp)
examples/convert_cache.py:21
↓ 1 callers
Function
demo
()
examples/time_machine_backtesting.py:26
↓ 1 callers
Method
dumps
(self, value)
tests/integration/test_sqlite.py:301
↓ 1 callers
Function
filter_sort_list
(data: List, ignored_parameters: ParamList = None)
requests_cache/cache_keys.py:279
↓ 1 callers
Function
filter_sort_multidict
( data: KVList, ignored_parameters: ParamList = None, )
requests_cache/cache_keys.py:271
↓ 1 callers
Method
from_cached_response
Create a CachedHTTPResponse based on a cached response
requests_cache/models/raw_response.py:63
↓ 1 callers
Method
from_kwargs
Constructor with some additional steps: * Handle some deprecated argument names * Ignore invalid settings, for easier initialization
requests_cache/policy/settings.py:54
↓ 1 callers
Function
get_504_response
Get a 504: Not Cached error response, for use with only-if-cached option
requests_cache/session.py:417
↓ 1 callers
Method
get_expire_offset
Return the time offset to use for expiration, if either min-fresh or max-stale is set
requests_cache/policy/directives.py:49
↓ 1 callers
Function
get_matched_headers
Get only the headers we should match against as a list of ``k=v`` strings, given an optional include list.
requests_cache/cache_keys.py:97
↓ 1 callers
Function
get_mock_adapter
Get a requests-mock Adapter with some URLs mocked by default
tests/conftest.py:181
← previous
next →
101–200 of 788, ranked by callers