Skip to main content

Cache

PyPI version PyPI downloads Python version Operating system Coverage

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)

Source distribution for persistent-function-cache 0.3.1
File Size Uploaded
persistent_function_cache-0.3.1.tar.gz 10.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for persistent-function-cache 0.3.1
File Interpreter ABI Platform
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}

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page