MCPcopy Create free account

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

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

↓ 1 callersFunctionget_randomized_response
Get a response with randomized content
examples/generate_test_db.py:80
↓ 1 callersFunctionget_request
(url)
tests/unit/test_session.py:327
↓ 1 callersFunctionget_responses
Contextmanager that provides a RequestsMock object mocked URLs and responses based on cache data
tests/compat/test_responses_load_cache.py:25
↓ 1 callersFunctionignore_deprecation
Temporarily silence deprecation warnings
tests/conftest.py:370
↓ 1 callersFunctioninit_converter
Make a converter to structure and unstructure nested objects within a :py:class:`.CachedResponse` Args: factory: An optional factory
requests_cache/serializers/cattrs.py:102
↓ 1 callersMethodinit_db
(self)
requests_cache/backends/filesystem.py:338
↓ 1 callersFunctioninstall_deps
Install project and test dependencies into a test-specific virtualenv using uv
noxfile.py:62
↓ 1 callersFunctionis_installed
Check if a given dependency is installed
tests/conftest.py:354
↓ 1 callersMethodis_older_than
Determine if this cached response is older than the given time
requests_cache/models/response.py:163
↓ 1 callersMethodkeys
(self)
requests_cache/backends/filesystem.py:167
↓ 1 callersMethodkeys
(self)
requests_cache/backends/redis.py:187
↓ 1 callersFunctionload_settings
Load settings from a YAML config file
examples/external_config.py:19
↓ 1 callersMethodloads
(self, *args, **kwargs)
requests_cache/_utils.py:63
↓ 1 callersMethodloads
(self, value)
requests_cache/serializers/cattrs.py:94
↓ 1 callersFunctionlog_requests
Context manager that mocks and logs all non-cached requests
examples/log_requests.py:21
↓ 1 callersFunctionmain
()
examples/pygithub.py:102
↓ 1 callersFunctionmain
Example usage; replace with any other requests you want to test
examples/log_requests.py:37
↓ 1 callersFunctionmain
()
examples/generate_test_db.py:104
↓ 1 callersFunctionmain
()
examples/basic_patching.py:16
↓ 1 callersFunctionmain
()
examples/basic_sessions.py:11
↓ 1 callersFunctionmain
()
examples/expiration.py:13
↓ 1 callersFunctionmain
()
examples/url_patterns.py:42
↓ 1 callersFunctionmake_sample_db
()
tests/generate_test_db.py:17
↓ 1 callersFunctionnormalize_url
Normalize and filter a URL. This includes request parameters, IDN domains, scheme, host, port, etc.
requests_cache/cache_keys.py:160
↓ 1 callersFunctionpopulate_cache
(progress, task)
examples/generate_test_db.py:45
↓ 1 callersFunctionrandom_request
()
examples/rps_graph.py:106
↓ 1 callersMethodrequest
(self, method: str, url: str, **kwargs)
examples/time_machine_backtesting.py:15
↓ 1 callersFunctionrun_cattrs
()
tests/benchmark_serializers.py:66
↓ 1 callersFunctionrun_cattrs_bson
()
tests/benchmark_serializers.py:88
↓ 1 callersFunctionrun_cattrs_pickle
()
tests/benchmark_serializers.py:70
↓ 1 callersFunctionrun_cattrs_ujson
()
tests/benchmark_serializers.py:83
↓ 1 callersFunctionrun_pickle
()
tests/benchmark_serializers.py:62
↓ 1 callersFunctionsave_test_data
Run once to save data to reuse for tests, for demo purposes. In practice, you could just run your application or tests with requests-cache install
tests/compat/test_requests_mock_load_cache.py:61
↓ 1 callersMethodserialize
(self, value: VT)
requests_cache/backends/sqlite.py:395
↓ 1 callersFunctionsigner_stage
Create a stage that uses ``itsdangerous`` to add a signature to responses on write, and validate that signature with a secret key on read. Can be
requests_cache/serializers/preconf.py:65
↓ 1 callersFunctionsplit_kwargs
Split ``kwargs`` into two dicts: those that are valid arguments for ``func``, and those that are not
requests_cache/_utils.py:89
↓ 1 callersMethodstream
Simplified generator over cached content that emulates :py:meth:`urllib3.response.HTTPResponse.stream()`
requests_cache/models/raw_response.py:110
↓ 1 callersMethodtest_all_response_formats
Test all relevant combinations of response formats X serializers
tests/integration/test_filesystem.py:491
↓ 1 callersFunctiontest_cache_key
Test that the custom cache keys are working as expected
examples/custom_request_matcher.py:44
↓ 1 callersFunctiontest_non_github_requests
Test that URL patterns are working, and that non-GitHub requests are not cached
examples/pygithub.py:79
↓ 1 callersFunctiontest_read_speed
(session)
examples/benchmark.py:55
↓ 1 callersFunctiontest_rps
(session)
examples/rps_graph.py:102
↓ 1 callersFunctiontest_write_speed
(session, max_size)
examples/benchmark.py:36
↓ 1 callersFunctiontimeout
Timeout decorator that uses threading instead of multiprocessing, for compatibility with pytest-xdist on python 3.14+.
tests/conftest.py:297
↓ 1 callersFunctionto_vcr_cassette
Export cached responses to a VCR-compatible YAML file (cassette) Args: cache: Cache instance containing response data to export p
examples/vcr.py:19
↓ 1 callersFunctionto_vcr_cassette_dicts_by_host
(responses: Iterable[CachedResponse])
examples/vcr.py:78
↓ 1 callersFunctionto_vcr_episode
Convert a single response to a VCR-compatible response ("episode") dict
examples/vcr.py:52
↓ 1 callersFunctiontry_int
Convert a value to an int, if possible, otherwise ``None``
requests_cache/_utils.py:102
↓ 1 callersMethodupdate_cache_size
(self, size: int)
examples/rps_graph.py:95
↓ 1 callersMethodupdate_request
Apply validation headers (if any) before sending a request
requests_cache/policy/actions.py:253
↓ 1 callersMethodwrap
Add caching to an existing :py:class:`~requests.Session` object, while retaining all original session settings. Args: ori
requests_cache/session.py:89
↓ 1 callersMethodwrap_response
Modify a response object in-place and add extra cache-related attributes
requests_cache/models/response.py:57
Method_
(self, value: CachedResponse)
requests_cache/serializers/cattrs.py:89
Method__attrs_post_init__
(self)
requests_cache/models/response.py:88
Method__contains__
(self, key)
requests_cache/backends/filesystem.py:151
Method__contains__
(self, key)
requests_cache/backends/redis.py:83
Method__contains__
(self, key)
requests_cache/backends/redis.py:157
Method__del__
(self)
requests_cache/backends/sqlite.py:319
Method__delitem__
(self, key)
requests_cache/backends/filesystem.py:142
Method__delitem__
Delete a file and remove it from the LRU index
requests_cache/backends/filesystem.py:263
Method__delitem__
(self, key)
requests_cache/backends/redis.py:102
Method__delitem__
(self, key)
requests_cache/backends/redis.py:169
Method__delitem__
(self, key)
requests_cache/backends/gridfs.py:108
Method__delitem__
(self, key)
requests_cache/backends/dynamodb.py:141
Method__delitem__
(self, key)
requests_cache/backends/mongodb.py:135
Method__delitem__
(self, key)
requests_cache/backends/sqlite.py:322
Method__enter__
Start live view on ctx enter
examples/rps_graph.py:67
Method__exit__
Show stats on ctx exit
examples/rps_graph.py:77
Method__getitem__
(self, key: str)
requests_cache/backends/filesystem.py:136
Method__getitem__
Get a value and update its access time in the LRU index
requests_cache/backends/filesystem.py:222
Method__getitem__
(self, key)
requests_cache/backends/redis.py:86
Method__getitem__
(self, key)
requests_cache/backends/redis.py:160
Method__getitem__
An additional step is needed here for response data. The original response object is still in memory, and hasn't gone through a serialize/dese
requests_cache/backends/base.py:395
Method__getitem__
(self, key)
requests_cache/backends/gridfs.py:85
Method__getitem__
(self, key)
requests_cache/backends/dynamodb.py:126
Method__getitem__
(self, key)
requests_cache/backends/mongodb.py:119
Method__getitem__
(self, key)
requests_cache/backends/sqlite.py:328
Method__getstate__
(self)
requests_cache/session.py:370
Method__getstate__
Override pickling behavior from ``requests.Response.__getstate__``
requests_cache/models/response.py:183
Method__init__
(self)
requests_cache/patcher.py:50
Method__init__
( self, cache_name: StrOrPath = DEFAULT_CACHE_NAME, backend: Optional[BackendSpecifier
requests_cache/session.py:44
Method__init__
(self, *args, **kwargs)
requests_cache/_utils.py:57
Method__init__
( self, factory: Optional[Callable[..., Converter]] = None, decode_content: bool = Fal
requests_cache/serializers/cattrs.py:70
Method__init__
( self, obj: Any = None, dumps: Union[str, Callable] = 'dumps', loads: Union[s
requests_cache/serializers/pipeline.py:23
Method__init__
(self, stages: Sequence, name: Optional[str] = None, is_binary: bool = False)
requests_cache/serializers/pipeline.py:50
Method__init__
( self, cache_name: StrOrPath = 'http_cache', use_temp: bool = False, decode_c
requests_cache/backends/filesystem.py:51
Method__init__
( self, cache_name: StrOrPath, use_temp: bool = False, use_cache_dir: bool = F
requests_cache/backends/filesystem.py:101
Method__init__
( self, *args, block_bytes: int = 1, max_cache_bytes: int = 100 * 1024 * 1024,
requests_cache/backends/filesystem.py:194
Method__init__
( self, namespace='http_cache', connection: Optional[Redis] = None, serializer
requests_cache/backends/redis.py:33
Method__init__
( self, namespace: str = 'http_cache', collection_name: Optional[str] = None,
requests_cache/backends/redis.py:144
Method__init__
( self, serializer: Optional[SerializerType] = None, decode_content: bool = False,
requests_cache/backends/base.py:323
Method__init__
(self, *args, **kwargs)
requests_cache/backends/base.py:391
Method__init__
( self, db_name: str, connection: MongoClient = None, decode_content: bool = F
requests_cache/backends/gridfs.py:33
Method__init__
( self, table_name: str = 'http_cache', create_table: bool = True, *,
requests_cache/backends/dynamodb.py:35
Method__init__
( self, db_name: str = 'http_cache', connection: MongoClient = None, decode_co
requests_cache/backends/mongodb.py:33
Method__init__
( self, db_path: StrOrPath = 'http_cache', serializer: Optional[SerializerType] = None
requests_cache/backends/sqlite.py:52
Method__init__
First initialize via HTTPResponse.__init__, then via __attrs_init__
requests_cache/models/raw_response.py:39
Method__init__
(self, **kwargs)
requests_cache/models/response.py:52
Method__init__
(self, content)
tests/unit/test_cache_keys.py:214
Method__init__
(self)
tests/unit/test_base_cache.py:37
← previousnext →201–300 of 788, ranked by callers