Persistent cache for expensive functions
Project description
Cache
Usage
Use
from persistent_cache import cache
@cache
def expensive_function(..):
..
to cache the result of a function
The cache key for the result is determined by:
- the function signature
- the implementation of the function
- the values of the function arguments
- custom transformations/reductions can be specified
Advantages compared to existing solutions:
- the cache in invalidated when the behavior of the function changes
- Each cache value is saved to a separate location. Only values that are effectively needed are loaded.
- works with function arguments of any complex data type.
- configurable: custom transformations/reductions can be specified based on the object type.
- 3 custom transformation groups available out-of-the-box:
- from persistent_cache import cache
- from persistent_cache.caches.deep_learning import cache
- from persistent_cache.caches.speedup_deep_learning import cache`
Installation
pip install persistent-function-cache
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file persistent_function_cache-0.1.0.tar.gz
.
File metadata
- Download URL: persistent_function_cache-0.1.0.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 870ad0050a1be3ac4c23f00e5a429e80d3dd2f5886bfc6c9a549af499017421b |
|
MD5 | 3f5e874dede775816d53ba991b797ee1 |
|
BLAKE2b-256 | 93c08eb1f8e2adc943f1aa0da558f65fc6ebfb6052563554efe16ae4924cba68 |
File details
Details for the file persistent_function_cache-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: persistent_function_cache-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb9338376ce1436d741be8d4e3fb78f4733aee33a2465394bd7135a83141333b |
|
MD5 | f74a0e44e2056be168d738bb14aca10c |
|
BLAKE2b-256 | efbd1be3d0c74b286700a44a8e9ba8525944d1223122a26c91425d2b2390bbc6 |