MCPcopy Create free account

hub / github.com/requests-cache/requests-cache / functions

Functions788 in github.com/requests-cache/requests-cache

↓ 3 callersFunctionuninstall_cache
Disable the cache by restoring the original :py:class:`requests.Session`
requests_cache/patcher.py:56
↓ 3 callersMethodupdate_revalidated_response
After revalidation, update the cached response's expiration and headers
requests_cache/policy/actions.py:258
↓ 2 callersMethod__delitem__
(self, key)
requests_cache/backends/filesystem.py:395
↓ 2 callersMethod__init__
( self, namespace: str, collection_name: Optional[str] = None, connection=None
requests_cache/backends/redis.py:60
↓ 2 callersMethod__rich_repr__
(self)
requests_cache/models/base.py:18
↓ 2 callersMethod_convert_redirects
Convert redirect history, if any; avoid recursion by not copying redirects of redirects
requests_cache/models/response.py:119
↓ 2 callersMethod_create_table
Create a default table if one does not already exist
requests_cache/backends/dynamodb.py:95
↓ 2 callersMethod_enable_ttl
Enable TTL, if not already enabled
requests_cache/backends/dynamodb.py:114
↓ 2 callersMethod_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 callersFunction_format
(unit)
requests_cache/models/response.py:212
↓ 2 callersFunction_is_method_allowed
Check request method as well as method override headers
requests_cache/policy/actions.py:405
↓ 2 callersFunction_log_cache_criteria
Log details on any failed checks for cache read or write
requests_cache/policy/actions.py:427
↓ 2 callersFunction_to_multidict
(d)
examples/vcr.py:57
↓ 2 callersMethodbulk_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 callersFunctioncoalesce
Get the first non-``None`` value in a list of values
requests_cache/_utils.py:23
↓ 2 callersMethodcopy
Create a copy of this pipeline and its stage objects
requests_cache/serializers/pipeline.py:57
↓ 2 callersMethodcount_request
(self)
examples/rps_graph.py:38
↓ 2 callersMethoddelete
(self, *args, **kwargs)
requests_cache/backends/gridfs.py:55
↓ 2 callersMethoddeserialize
Handle Binary objects from a custom serializer
requests_cache/backends/dynamodb.py:178
↓ 2 callersMethoddumps
(self, *args, **kwargs)
requests_cache/_utils.py:60
↓ 2 callersMethoddumps
(self, value)
requests_cache/serializers/cattrs.py:85
↓ 2 callersFunctionfilter_sort_json
(data: Union[List, Mapping], ignored_parameters: ParamList)
requests_cache/cache_keys.py:254
↓ 2 callersFunctionformat_datetime
Get a formatted datetime string in the local time zone
requests_cache/models/response.py:201
↓ 2 callersMethodfrom_request
Create a CachedRequest based on an original request object
requests_cache/models/request.py:26
↓ 2 callersFunctionget_cache_path
Get a resolved cache path
requests_cache/backends/sqlite.py:481
↓ 2 callersFunctionget_randomized_response
Get a response with randomized content
examples/benchmark.py:75
↓ 2 callersFunctionget_user_info
Display some info about your own resources on GitHub
examples/pygithub.py:50
↓ 2 callersMethodhead
(self, url: str, **kwargs)
requests_cache/session.py:139
↓ 2 callersFunctioninit_backend
Initialize a backend from a name, class, or instance
requests_cache/backends/__init__.py:63
↓ 2 callersMethodinit_cache
(self, index=0, clear=True, **kwargs)
tests/integration/test_filesystem.py:46
↓ 2 callersMethoditems
Get all ``(key, value)`` pairs in the hash
requests_cache/backends/redis.py:191
↓ 2 callersMethodloads
(self, value)
tests/integration/test_sqlite.py:295
↓ 2 callersMethodnext_interval
Create a new task to draw the next line on the bar chart
examples/rps_graph.py:33
↓ 2 callersFunctionnormalize_body
Normalize and filter a request body if possible, depending on Content-Type
requests_cache/cache_keys.py:168
↓ 2 callersFunctionnormalize_params
Normalize and filter urlencoded params from either a URL or request body with form data
requests_cache/cache_keys.py:223
↓ 2 callersMethodoptions
(self, url: str, **kwargs)
requests_cache/session.py:135
↓ 2 callersMethodpatch
(self, url: str, data=None, **kwargs)
requests_cache/session.py:149
↓ 2 callersFunctionpatch_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 callersFunctionredact_response
Redact any ignored parameters (potentially containing sensitive info) from a cached request
requests_cache/cache_keys.py:239
↓ 2 callersMethodremove_expired_responses
(self, expire_after: ExpirationTime = None)
requests_cache/backends/base.py:261
↓ 2 callersFunctionsend_requests
()
examples/threads.py:21
↓ 2 callersFunctionsend_requests
()
examples/url_patterns.py:24
↓ 2 callersFunctionto_vcr_cassette_dict
Convert responses to a VCR cassette dict
examples/vcr.py:44
↓ 2 callersMethodwrite
(i)
tests/integration/base_storage_test.py:184
↓ 2 callersFunctionwrite_cassette
(cassette, path)
examples/vcr.py:87
↓ 1 callersMethod__getitem__
(self, key)
requests_cache/backends/filesystem.py:401
↓ 1 callersMethod__init__
(self, cache_name: str = DEFAULT_CACHE_NAME, **kwargs)
requests_cache/backends/base.py:54
↓ 1 callersMethod__init__
( self, db_name, collection_name=None, connection=None, serializer: Op
requests_cache/backends/gridfs.py:70
↓ 1 callersMethod__init__
( self, table_name: str, create_table: bool = True, ttl: bool = True,
requests_cache/backends/dynamodb.py:72
↓ 1 callersMethod__init__
( self, db_name: str, collection_name: str = 'http_cache', connection: Optiona
requests_cache/backends/mongodb.py:83
↓ 1 callersMethod__init__
( self, db_path: StrOrPath, table_name: str = 'http_cache', busy_timeout: Opti
requests_cache/backends/sqlite.py:196
↓ 1 callersMethod__setitem__
Save a value (file size), and update access time and total cache size
requests_cache/backends/filesystem.py:410
↓ 1 callersMethod_bkeys
(self, keys: Iterable[str])
requests_cache/backends/redis.py:80
↓ 1 callersMethod_cookies_match
Compare cookies between the current request and cached request for Vary: Cookie
requests_cache/policy/actions.py:383
↓ 1 callersFunction_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 callersFunction_decode_content
Decode response body into a human-readable format, if possible
requests_cache/serializers/cattrs.py:180
↓ 1 callersMethod_delete_expired
A more efficient implementation of deleting expired responses in SQL
requests_cache/backends/sqlite.py:126
↓ 1 callersFunction_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 callersMethod_estimate_size
Estimate the current size of the database based on page count * size
requests_cache/backends/sqlite.py:408
↓ 1 callersFunction_expires_str
(response)
examples/url_patterns.py:33
↓ 1 callersFunction_float_to_decimal
(value: DecodedContent)
requests_cache/serializers/cattrs.py:231
↓ 1 callersFunction_format_sequence
Get SQL parameter marks for a sequence-based query
requests_cache/backends/sqlite.py:459
↓ 1 callersFunction_get_extension
Use either the provided file extension, or get the serializer's default extension
requests_cache/backends/filesystem.py:494
↓ 1 callersFunction_get_sqlite_cache_path
Get a resolved path for a SQLite database file (or memory URI)
requests_cache/backends/sqlite.py:464
↓ 1 callersMethod_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 callersFunction_log_vary_diff
Log which specific headers specified by Vary did not match
requests_cache/policy/actions.py:413
↓ 1 callersMethod_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 callersFunction_parse_http_date
Attempt to parse an HTTP (RFC 5322-compatible) timestamp
requests_cache/policy/expiration.py:94
↓ 1 callersMethod_prune_redirects
Remove any redirects that no longer point to an existing response
requests_cache/backends/base.py:206
↓ 1 callersMethod_prune_redirects
A more efficient implementation of removing invalid redirects in SQL
requests_cache/backends/sqlite.py:134
↓ 1 callersMethod_rename_kwargs
(kwargs)
requests_cache/policy/settings.py:65
↓ 1 callersMethod_resend
Handle a stale cached response by attempting to resend the request and cache a fresh response
requests_cache/session.py:299
↓ 1 callersMethod_resend_async
Send a non-blocking request to refresh a cached response
requests_cache/session.py:321
↓ 1 callersMethod_set_ttl
(self, ttl: int, overwrite: bool = False)
requests_cache/backends/mongodb.py:110
↓ 1 callersFunction_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 callersMethod_sync_lru_index
Rebuild the LRU index from files on disk
requests_cache/backends/filesystem.py:291
↓ 1 callersMethod_update_from_response_headers
Check response headers for expiration and other cache directives
requests_cache/policy/actions.py:290
↓ 1 callersMethod_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 callersFunction_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 callersMethod_validate_vary
If the cached response contains Vary, check that the specified request headers match
requests_cache/policy/actions.py:328
↓ 1 callersMethod_write
(self, key, value)
requests_cache/backends/sqlite.py:343
↓ 1 callersFunctionassert_delta_approx_equal
Assert that the given datetimes are approximately ``target_delta`` seconds apart
tests/conftest.py:291
↓ 1 callersMethodbulk_delete
Delete multiple keys from the cache. Does not raise errors for missing keys.
requests_cache/backends/dynamodb.py:169
↓ 1 callersMethodbulk_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 callersFunctioncheck_cache
Check some information on cached requests
examples/pygithub.py:88
↓ 1 callersFunctionchunkify
Split an iterable into chunks of a max size
requests_cache/_utils.py:16
↓ 1 callersFunctionclean
Clean up temporary build + documentation files
noxfile.py:89
↓ 1 callersMethodclear
(self)
requests_cache/backends/sqlite.py:376
↓ 1 callersFunctionconvert_cache
(*args, **kwargs)
examples/convert_cache.py:31
↓ 1 callersFunctionconvert_old_response
(cached_response, timestamp)
examples/convert_cache.py:21
↓ 1 callersFunctiondemo
()
examples/time_machine_backtesting.py:26
↓ 1 callersMethoddumps
(self, value)
tests/integration/test_sqlite.py:301
↓ 1 callersFunctionfilter_sort_list
(data: List, ignored_parameters: ParamList = None)
requests_cache/cache_keys.py:279
↓ 1 callersFunctionfilter_sort_multidict
( data: KVList, ignored_parameters: ParamList = None, )
requests_cache/cache_keys.py:271
↓ 1 callersMethodfrom_cached_response
Create a CachedHTTPResponse based on a cached response
requests_cache/models/raw_response.py:63
↓ 1 callersMethodfrom_kwargs
Constructor with some additional steps: * Handle some deprecated argument names * Ignore invalid settings, for easier initialization
requests_cache/policy/settings.py:54
↓ 1 callersFunctionget_504_response
Get a 504: Not Cached error response, for use with only-if-cached option
requests_cache/session.py:417
↓ 1 callersMethodget_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 callersFunctionget_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 callersFunctionget_mock_adapter
Get a requests-mock Adapter with some URLs mocked by default
tests/conftest.py:181
← previousnext →101–200 of 788, ranked by callers