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
Metadata
Release files for persistent-function-cache 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| persistent_function_cache-0.3.1.tar.gz | 10.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| persistent_function_cache-0.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.8 kB
Release files / persistent_function_cache-0.3.1.tar.gz
| Download URL | persistent_function_cache-0.3.1.tar.gz |
|---|---|
| Size | 10.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7f356ae8dfdb17594173d1c858fcca9198efed4c5e9b9c0e41094c8bedf0acfd
|
|
BLAKE2b-256 checksum How to use checksums |
f1689f14dc63fa74bb981a04b035476543d5536822321dbc420e6da5f5dfd7f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / persistent_function_cache-0.3.1-py3-none-any.whl
| Download URL | persistent_function_cache-0.3.1-py3-none-any.whl |
|---|---|
| Size | 11.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
edb19aca6b8be11ce2ea0457d17ac244f682addc63ea4bf09696a43da6dbfdd7
|
|
BLAKE2b-256 checksum How to use checksums |
94ce37c092e1831b0a27cbd789299dd19c2a0321a797f46bff4a38026ef36071
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|