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
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file persistent_function_cache-0.2.2.tar.gz.
File metadata
- Download URL: persistent_function_cache-0.2.2.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1f4f275125b303ade896791d3b681575454422e73896efdabaf0f8a40aee219
|
|
| MD5 |
1b13efcb68ecea98744a69c72949431c
|
|
| BLAKE2b-256 |
6e7dcc177c6c4139bc184d8b990d109f3b2119dbb88e49d562e6acf6a9c2e051
|
Provenance
The following attestation bundles were made for persistent_function_cache-0.2.2.tar.gz:
Publisher:
build.yml on quintenroets/persistent-cache
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
persistent_function_cache-0.2.2.tar.gz -
Subject digest:
e1f4f275125b303ade896791d3b681575454422e73896efdabaf0f8a40aee219 - Sigstore transparency entry: 163576755
- Sigstore integration time:
-
Permalink:
quintenroets/persistent-cache@4e220219f7ab9bee0fad496a7e557b836be7daa8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/quintenroets
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@4e220219f7ab9bee0fad496a7e557b836be7daa8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file persistent_function_cache-0.2.2-py3-none-any.whl.
File metadata
- Download URL: persistent_function_cache-0.2.2-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fca3ad49d52ac0779e3e587a96bf57f6418c0bf3ca59f3543d7523c71549d63f
|
|
| MD5 |
d4209c6f8482b8a064d391b4bd85c128
|
|
| BLAKE2b-256 |
d304500b4e48431ce15ba7fd7809f1e21060e9f2d5f89a8c0d1af6c2346748b2
|
Provenance
The following attestation bundles were made for persistent_function_cache-0.2.2-py3-none-any.whl:
Publisher:
build.yml on quintenroets/persistent-cache
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
persistent_function_cache-0.2.2-py3-none-any.whl -
Subject digest:
fca3ad49d52ac0779e3e587a96bf57f6418c0bf3ca59f3543d7523c71549d63f - Sigstore transparency entry: 163576756
- Sigstore integration time:
-
Permalink:
quintenroets/persistent-cache@4e220219f7ab9bee0fad496a7e557b836be7daa8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/quintenroets
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@4e220219f7ab9bee0fad496a7e557b836be7daa8 -
Trigger Event:
push
-
Statement type: