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.1.tar.gz (9.8 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.1-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for persistent_function_cache-0.2.1.tar.gz
Algorithm Hash digest
SHA256 d4f012f4e0e5172d425e21d10d77c8ead4cf8eb8b581ad7e91f51892a6edb52b
MD5 05a2b57e715831e6dafbb41c1a67785e
BLAKE2b-256 847109a46c234d4905a83d0cae8671f47534582ae6ef91a9f76c84401930ebba

See more details on using hashes here.

Provenance

The following attestation bundles were made for persistent_function_cache-0.2.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for persistent_function_cache-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5e6352ccf898db1ea57b7bb8530fed8909d0ba1d8f5cf0f92e09aa088c65e6c0
MD5 b6fb886410317b45fbdfc0238e281dcb
BLAKE2b-256 7b39aec04ee957039d7d22f3fae6650077eae8a138e1babf6c307164904c45d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for persistent_function_cache-0.2.1-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