{"categories":[{"label":"Software Development","url":"https://skillfed.io/packages/category/software-development/16"}],"enrichment":{"capability":"A decorator that caches function results to disk with pickle serialization and automatic expiration based on a configurable number of days.","skillfed_tags":["caching","persistence","memoization"],"use_cases":["Cache expensive data-processing pipelines that return large objects for days at a time.","Avoid re-querying slow external APIs or databases when the same arguments are used within a cache window.","Store intermediate results from long-running computations without consuming RAM.","Manually invalidate cached results when a function's logic changes or external data is updated.","Track cache performance with cache_info() to understand hit rates and identify optimization opportunities."],"what_it_does":"cache_to_disk is a Python decorator that persists function results to disk as pickled files instead of holding them in memory. It's designed for functions that are expensive to run and produce large return values\u2014cases where in-memory caching would be wasteful. Each cached result is keyed by the function's arguments, so different argument combinations trigger fresh execution. You specify a cache lifetime in days; after that period, the cached file is deleted on the next module import.\n\nThe package provides three main functions: the @cache_to_disk(n_days) decorator itself, a delete_disk_caches_for_function() utility to manually invalidate a function's cache, and a cache_info() method to inspect hit/miss statistics. It also supports a NoCacheCondition exception to prevent caching in error scenarios while still returning a partial result.","worth_installing":"Yes, if you need simple, argument-aware disk caching for expensive functions and can accept dormant maintenance. The package is permissive-licensed, has no dependencies, and installs easily. However, the last update was in 2021\u2014if you need active support, bug fixes, or compatibility with future Python versions, consider alternatives or be prepared to maintain a fork."},"id":"cache-to-disk","links":{"html":"https://skillfed.io/packages/cache-to-disk","md":"https://skillfed.io/packages/cache-to-disk.md","pypi":"https://pypi.org/project/cache-to-disk/"},"maintenance":{"status":"dormant"},"meta":{"latest_release":"2021-12-07","license_spdx":null,"license_treatment":"permissive","name":"cache-to-disk","python_support":"unspecified","summary":"Local disk caching decorator for python function."},"popularity":{"monthly_downloads":110646,"position":12448,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"2.0.0"}
