MCPcopy Create free account

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

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

Method__init__
(self, param)
tests/unit/test_patcher.py:52
Method__init__
(self, interval: int = 1, scale: int = 500, **kwargs)
examples/rps_graph.py:24
Method__init__
(self, n_unique_requests: int = 100)
examples/rps_graph.py:48
Method__iter__
(self)
requests_cache/backends/filesystem.py:155
Method__iter__
(self)
requests_cache/backends/redis.py:106
Method__iter__
(self)
requests_cache/backends/redis.py:173
Method__iter__
(self)
requests_cache/backends/gridfs.py:118
Method__iter__
(self)
requests_cache/backends/dynamodb.py:146
Method__iter__
(self)
requests_cache/backends/mongodb.py:143
Method__iter__
(self)
requests_cache/backends/sqlite.py:353
Method__len__
(self)
requests_cache/backends/filesystem.py:158
Method__len__
(self)
requests_cache/backends/redis.py:109
Method__len__
(self)
requests_cache/backends/redis.py:176
Method__len__
(self)
requests_cache/backends/gridfs.py:115
Method__len__
Get the number of items in the table. **Note:** This is an estimate, and is updated every 6 hours. A full table scan will use up your
requests_cache/backends/dynamodb.py:161
Method__len__
(self)
requests_cache/backends/mongodb.py:140
Method__len__
(self)
requests_cache/backends/sqlite.py:358
Method__len__
(self)
tests/unit/test_cache_keys.py:217
Method__repr__
(self)
requests_cache/session.py:376
Method__repr__
(self)
requests_cache/backends/base.py:295
Method__repr__
(self)
requests_cache/models/base.py:26
Method__setitem__
(self, key, value)
requests_cache/backends/filesystem.py:146
Method__setitem__
(self, key: str, value: Any)
requests_cache/backends/filesystem.py:238
Method__setitem__
Save an item to the cache, optionally with TTL
requests_cache/backends/redis.py:92
Method__setitem__
(self, key, item)
requests_cache/backends/redis.py:166
Method__setitem__
(self, key, item)
requests_cache/backends/gridfs.py:96
Method__setitem__
(self, key, value)
requests_cache/backends/dynamodb.py:132
Method__setitem__
If ``value`` is already a dict, its values will be stored under top-level keys. Otherwise, it will be stored under a 'data' key.
requests_cache/backends/mongodb.py:126
Method__setitem__
(self, key, value)
requests_cache/backends/sqlite.py:340
Method__setstate__
Override pickling behavior from ``requests.Response.__setstate__``
requests_cache/models/response.py:187
Method__setstate__
(self, value)
tests/unit/test_base_cache.py:40
Method__setstate__
(self, d)
examples/generate_test_db.py:41
Method__str__
(self)
requests_cache/serializers/pipeline.py:81
Method__str__
(self)
requests_cache/backends/base.py:292
Method__str__
(self)
requests_cache/backends/base.py:377
Method__str__
(self)
requests_cache/models/response.py:192
Method__str__
(self)
requests_cache/models/request.py:62
Method_content_consumed
For compatibility with requests.Response; will always be True for a cached response
requests_cache/models/response.py:127
Function_convert_floats
Workaround for DynamoDB-specific issue with decode_content=True. There doesn't seem to be an obvious way to do this with the current converter set
requests_cache/serializers/cattrs.py:226
Method_cookies
For compatibility with PreparedRequest, which has an attribute named '_cookies', and a keyword argument named 'cookies'.
requests_cache/models/request.py:56
Method_request_url
For compatibility with urllib3
requests_cache/models/raw_response.py:75
Function_send_request
Concurrent request function for stress tests. Defined in module scope so it can be serialized to multiple processes.
tests/integration/base_cache_test.py:440
Function_to_datetime
(obj, cls)
requests_cache/serializers/cattrs.py:246
Function_to_timedelta
(obj, cls)
requests_cache/serializers/cattrs.py:252
Functionadd_tzinfo
Add a UTC timezone to a datetime object, if it doesn't already have one. This is used mainly during deserialization for backends that don't store
requests_cache/policy/expiration.py:80
Methodbulk_delete
Delete multiple keys from the cache, without raising errors for missing keys
requests_cache/backends/redis.py:179
Methodbulk_delete
Delete multiple keys from the cache. Does not raise errors for missing keys.
requests_cache/backends/mongodb.py:147
Methodcache_dir
Base directory for cache files
requests_cache/backends/filesystem.py:75
Functionclear
Clear the currently installed cache (if any)
requests_cache/patcher.py:109
Methodclear
Clear the cache
requests_cache/backends/filesystem.py:83
Methodclear
Empty the cache directory.
requests_cache/backends/filesystem.py:161
Methodclear
Clear the cache directory and LRU index.
requests_cache/backends/filesystem.py:306
Methodclear
(self)
requests_cache/backends/redis.py:117
Methodclear
(self)
requests_cache/backends/redis.py:184
Methodclear
(self)
requests_cache/backends/gridfs.py:122
Methodclear
(self)
requests_cache/backends/dynamodb.py:175
Methodclear
(self)
requests_cache/backends/mongodb.py:151
Methodclear
Delete all items from the cache. If this fails due to a corrupted cache or other I/O error, this will attempt to delete the cache file and re
requests_cache/backends/sqlite.py:74
Methodclose
(self)
requests_cache/backends/redis.py:120
Methodclose
Close any open backend connections
requests_cache/backends/base.py:344
Methodclose
(self)
requests_cache/backends/mongodb.py:154
Methodcopy
(self)
requests_cache/serializers/cattrs.py:79
Methodcopy
Return a copy of the CachedRequest
requests_cache/models/request.py:39
Functioncopy_module_docs
Copy manually written doc sources to apidoc directory
docs/conf.py:175
Methodcount
(self, *args, **kwargs)
requests_cache/backends/filesystem.py:430
Methodcount
Count number of responses, optionally excluding expired Args: expired: Set to ``False`` to count only unexpired responses
requests_cache/backends/sqlite.py:147
Methodcount_request
(self)
examples/rps_graph.py:92
Functioncoverage
Run tests and generate coverage report
noxfile.py:97
Functioncreate_custom_key
Create a key based on only the request URL (without params)
tests/unit/test_session.py:749
Functioncreate_custom_key
Make a custom cache key that includes library versions
examples/custom_request_matcher.py:28
Methoddb_path
Path to the cache database file. Raises: NotImplementedError: For backends that do not use a file-based database.
requests_cache/backends/base.py:61
Methoddb_path
(self)
requests_cache/backends/sqlite.py:71
Functiondecorator
(func)
tests/conftest.py:302
Functiondelete
Remove responses from the cache according one or more conditions. See :py:meth:`.BaseCache.delete` for usage details.
requests_cache/patcher.py:115
Methoddelete
(self, *args, **kwargs)
requests_cache/backends/filesystem.py:90
Methoddelete
Remove responses from the cache according one or more conditions. Args: keys: Remove responses with these cache keys
requests_cache/backends/sqlite.py:88
Functiondisabled
Context manager for temporarily disabling caching for all ``requests`` functions Example: >>> with requests_cache.disabled():
requests_cache/patcher.py:62
Methoddo_noop_bulk
(cache)
tests/integration/test_sqlite.py:117
Functiondocs
Build Sphinx documentation
noxfile.py:129
Methoddumps
(self, value)
requests_cache/serializers/pipeline.py:65
Functionenabled
Context manager for temporarily enabling caching for all ``requests`` functions Example: >>> with requests_cache.enabled('cache.db'
requests_cache/patcher.py:81
Functionensure_connection
Fail all tests in this module if MongoDB is not running
tests/integration/test_mongodb.py:26
Functionensure_connection
Fail all tests in this module if DynamoDB is not running
tests/integration/test_dynamodb.py:23
Functionensure_connection
Fail all tests in this module if Redis is not running
tests/integration/test_redis.py:14
Methodexpire_after
(self)
requests_cache/session.py:123
Methodexpires
Convert the user/header-provided expiration value to a datetime. Applies to new cached responses, and previously cached responses that are bei
requests_cache/policy/actions.py:149
Methodexpires_delta
Get time to expiration in seconds (rounded to the nearest second)
requests_cache/models/response.py:136
Methodexpires_unix
Get expiration time as a Unix timestamp
requests_cache/models/response.py:144
Functionfail_if_no_connection
Decorator for testing a backend connection. This will intentionally cause a test failure if the wrapped function doesn't have dependencies install
tests/conftest.py:331
Methodfilter
( self, valid: bool = True, expired: bool = True, invalid: bool = False,
requests_cache/backends/sqlite.py:156
Functionfind_local_mod_objs
(*args, **kwargs)
docs/conf.py:168
Methodfrom_cache
(self)
requests_cache/models/response.py:40
Methodfrom_cache
(self)
requests_cache/models/response.py:151
Methodfrom_response
Create a CachedHTTPResponse based on an original response, and restore the response to its previous state.
requests_cache/models/raw_response.py:49
Methodget_json
(url)
tests/integration/base_cache_test.py:143
Methodget_ttl
Get the currently defined TTL value in seconds, if any
requests_cache/backends/mongodb.py:58
Methodhas_validator
(self)
requests_cache/policy/directives.py:59
Functionhook_func
(r, *args, **kwargs)
tests/unit/test_session.py:765
Functionhttpbin_wrapper
Allow pytest-httpbin to be used instead of the httpbin Docker container. This fixture does not need to be used manually. It will be autoused if bo
tests/conftest.py:116
Functioninstalled_session
Get a CachedSession using a temporary SQLite db, with global patching. Installs cache before test and uninstalls after.
tests/conftest.py:160
← previousnext →301–400 of 788, ranked by callers