Requests-cache

Latest version: v1.2.0

Safety actively analyzes 631310 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 9

0.7.4

* Fix an issue with httpdate strings from `Expires` headers not getting converted to UTC
* Fix a packaging issue with extra files added to top-level wheel directory
* Fix some issues with parallelizing tests using pytest-xdist

0.7.3

* SQLite backend:
* Update `DbCache.clear()` to succeed even if the database is corrupted
* Update `DbDict.bulk_delete()` to split the operation into multiple statements to support deleting more items than SQLite's variable limit (999)
* Filesystem backend:
* When using JSON serializer, pretty-print JSON by default
* Add an appropriate file extension to cache files (`.json`, `.yaml`, `.pkl`, etc.) by default; can be overridden or disabled with the `extension` parameter.
* Add a `BaseCache.delete_urls()` method to bulk delete multiple responses from the cache based on
request URL

0.7.2

* Add support for `Response.next` (to get the next request in a redirect chain) when 302 responses are cached directly
* Add a `CachedResponse.cache_key` attribute
* Make `CachedResponse` a non-slotted class to allow client code to set arbitrary attributes on it

0.7.1

* Fix a bug in which Cache-Control headers would be used unexpectedly

0.7.0

[See all issues and PRs for 0.7](https://github.com/requests-cache/requests-cache/milestone/2?closed=1)

🕗 **Expiration & headers:**
* Add optional support for the following **request** headers:
* `Cache-Control: max-age`
* `Cache-Control: no-cache`
* `Cache-Control: no-store`
* Add optional support for the following **response** headers:
* `Cache-Control: max-age`
* `Cache-Control: no-store`
* `Expires`
* Add `cache_control` option to `CachedSession` to enable setting expiration with cache headers
* Add support for HTTP timestamps (RFC 5322) in ``expire_after`` parameters
* Add support for bypassing the cache if `expire_after=0`
* Add support for making a cache allowlist using URL patterns

💾 **Backends:**
* Add a filesystem backend that stores responses as local files
* **DynamoDB:**
* Fix `DynamoDbDict.__iter__` to return keys instead of values
* Accept connection arguments for `boto3.resource`
* **MongoDB:**
* Remove usage of deprecated pymongo `Collection.find_and_modify()`
* Accept connection arguments for `pymongo.MongoClient`
* **Redis:**
* Accept connection arguments for `redis.Redis`
* **SQLite:**
* Use persistent thread-local connections, and improve performance for bulk operations
* Add `use_temp` option to store files in a temp directory
* Accept connection arguments for `sqlite3.connect`

💾 **Serialization:**
* Add data models for all serialized objects
* Add a JSON serializer
* Add a YAML serializer
* Add a BSON serializer
* Add optional support for `cattrs`
* Add optional support for `ultrajson`

↔️ **Request matching:**
* Add support for caching multipart form uploads
* Update `ignored_parameters` to also exclude ignored request params, body params, or headers from cached response data (to avoid storing API keys or other credentials)
* Update `old_data_on_error` option to also handle error response codes
* Only log request exceptions if `old_data_on_error` is set

ℹ️ **Convenience methods:**
* Add option to manually cache response objects with `BaseCache.save_response()`
* Add `BaseCache.keys()` and `values()` methods
* Add `BaseCache.response_count()` method to get an accurate count of responses (excluding invalid and expired)
* Show summarized response details with `str(CachedResponse)`
* Add more detailed repr methods for `CachedSession`, `CachedResponse`, and `BaseCache`
* Update `BaseCache.urls` to only skip invalid responses, not delete them (for better performance)

📦 **Dependencies:**
* Add minimum `requests` version of `2.17`
* Add `attrs` as a dependency for improved serialization models
* Add `cattrs` as an optional dependency
* Add some package extras to install optional dependencies (via `pip install`):
* `requests-cache[all]` (to install everything)
* `requests-cache[bson]`
* `requests-cache[json]`
* `requests-cache[dynamodb]`
* `requests-cache[mongodb]`
* `requests-cache[redis]`

📦 **Compatibility and packaging:**
* requests-cache is now fully typed and PEP-561 compliant
* Fix some compatibility issues with `requests 2.17` and `2.18`
* Run pre-release tests for each supported version of `requests`
* Packaging is now managed by Poetry
* For users, installation still works the same.
* For developers, see [Contributing Guide](https://requests-cache.readthedocs.io/en/stable/project_info/contributing.html) for details


-----

0.6.4

* Fix a bug in which `filter_fn()` would get called on `response.request` instead of `response`

Page 4 of 9

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.