Skip to main content

Persistent cache for expensive functions

Project description

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

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

persistent_function_cache-0.2.2.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

persistent_function_cache-0.2.2-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file persistent_function_cache-0.2.2.tar.gz.

File metadata

File hashes

Hashes for persistent_function_cache-0.2.2.tar.gz
Algorithm Hash digest
SHA256 e1f4f275125b303ade896791d3b681575454422e73896efdabaf0f8a40aee219
MD5 1b13efcb68ecea98744a69c72949431c
BLAKE2b-256 6e7dcc177c6c4139bc184d8b990d109f3b2119dbb88e49d562e6acf6a9c2e051

See more details on using hashes here.

Provenance

The following attestation bundles were made for persistent_function_cache-0.2.2.tar.gz:

Publisher: build.yml on quintenroets/persistent-cache

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file persistent_function_cache-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for persistent_function_cache-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fca3ad49d52ac0779e3e587a96bf57f6418c0bf3ca59f3543d7523c71549d63f
MD5 d4209c6f8482b8a064d391b4bd85c128
BLAKE2b-256 d304500b4e48431ce15ba7fd7809f1e21060e9f2d5f89a8c0d1af6c2346748b2

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page