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
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
Function
add_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
Method
bulk_delete
Delete multiple keys from the cache, without raising errors for missing keys
requests_cache/backends/redis.py:179
Method
bulk_delete
Delete multiple keys from the cache. Does not raise errors for missing keys.
requests_cache/backends/mongodb.py:147
Method
cache_dir
Base directory for cache files
requests_cache/backends/filesystem.py:75
Function
clear
Clear the currently installed cache (if any)
requests_cache/patcher.py:109
Method
clear
Clear the cache
requests_cache/backends/filesystem.py:83
Method
clear
Empty the cache directory.
requests_cache/backends/filesystem.py:161
Method
clear
Clear the cache directory and LRU index.
requests_cache/backends/filesystem.py:306
Method
clear
(self)
requests_cache/backends/redis.py:117
Method
clear
(self)
requests_cache/backends/redis.py:184
Method
clear
(self)
requests_cache/backends/gridfs.py:122
Method
clear
(self)
requests_cache/backends/dynamodb.py:175
Method
clear
(self)
requests_cache/backends/mongodb.py:151
Method
clear
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
Method
close
(self)
requests_cache/backends/redis.py:120
Method
close
Close any open backend connections
requests_cache/backends/base.py:344
Method
close
(self)
requests_cache/backends/mongodb.py:154
Method
copy
(self)
requests_cache/serializers/cattrs.py:79
Method
copy
Return a copy of the CachedRequest
requests_cache/models/request.py:39
Function
copy_module_docs
Copy manually written doc sources to apidoc directory
docs/conf.py:175
Method
count
(self, *args, **kwargs)
requests_cache/backends/filesystem.py:430
Method
count
Count number of responses, optionally excluding expired Args: expired: Set to ``False`` to count only unexpired responses
requests_cache/backends/sqlite.py:147
Method
count_request
(self)
examples/rps_graph.py:92
Function
coverage
Run tests and generate coverage report
noxfile.py:97
Function
create_custom_key
Create a key based on only the request URL (without params)
tests/unit/test_session.py:749
Function
create_custom_key
Make a custom cache key that includes library versions
examples/custom_request_matcher.py:28
Method
db_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
Method
db_path
(self)
requests_cache/backends/sqlite.py:71
Function
decorator
(func)
tests/conftest.py:302
Function
delete
Remove responses from the cache according one or more conditions. See :py:meth:`.BaseCache.delete` for usage details.
requests_cache/patcher.py:115
Method
delete
(self, *args, **kwargs)
requests_cache/backends/filesystem.py:90
Method
delete
Remove responses from the cache according one or more conditions. Args: keys: Remove responses with these cache keys
requests_cache/backends/sqlite.py:88
Function
disabled
Context manager for temporarily disabling caching for all ``requests`` functions Example: >>> with requests_cache.disabled():
requests_cache/patcher.py:62
Method
do_noop_bulk
(cache)
tests/integration/test_sqlite.py:117
Function
docs
Build Sphinx documentation
noxfile.py:129
Method
dumps
(self, value)
requests_cache/serializers/pipeline.py:65
Function
enabled
Context manager for temporarily enabling caching for all ``requests`` functions Example: >>> with requests_cache.enabled('cache.db'
requests_cache/patcher.py:81
Function
ensure_connection
Fail all tests in this module if MongoDB is not running
tests/integration/test_mongodb.py:26
Function
ensure_connection
Fail all tests in this module if DynamoDB is not running
tests/integration/test_dynamodb.py:23
Function
ensure_connection
Fail all tests in this module if Redis is not running
tests/integration/test_redis.py:14
Method
expire_after
(self)
requests_cache/session.py:123
Method
expires
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
Method
expires_delta
Get time to expiration in seconds (rounded to the nearest second)
requests_cache/models/response.py:136
Method
expires_unix
Get expiration time as a Unix timestamp
requests_cache/models/response.py:144
Function
fail_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
Method
filter
( self, valid: bool = True, expired: bool = True, invalid: bool = False,
requests_cache/backends/sqlite.py:156
Function
find_local_mod_objs
(*args, **kwargs)
docs/conf.py:168
Method
from_cache
(self)
requests_cache/models/response.py:40
Method
from_cache
(self)
requests_cache/models/response.py:151
Method
from_response
Create a CachedHTTPResponse based on an original response, and restore the response to its previous state.
requests_cache/models/raw_response.py:49
Method
get_json
(url)
tests/integration/base_cache_test.py:143
Method
get_ttl
Get the currently defined TTL value in seconds, if any
requests_cache/backends/mongodb.py:58
Method
has_validator
(self)
requests_cache/policy/directives.py:59
Function
hook_func
(r, *args, **kwargs)
tests/unit/test_session.py:765
Function
httpbin_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
Function
installed_session
Get a CachedSession using a temporary SQLite db, with global patching. Installs cache before test and uninstalls after.
tests/conftest.py:160
← previous
next →
301–400 of 788, ranked by callers