{"categories":[{"label":"Libraries","url":"https://skillfed.io/packages/category/software-development-libraries/8"},{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/17"},{"label":"Utilities","url":"https://skillfed.io/packages/category/utilities/8"},{"label":"Other/Nonlisted Topic","url":"https://skillfed.io/packages/category/other-nonlisted-topic"}],"enrichment":{"capability":"Cachier is a decorator that adds persistent, expiring caching to Python functions, supporting local pickle files, in-memory storage, MongoDB, SQL databases, Redis, and S3 backends.","skillfed_tags":["memoization","persistence","decorator"],"use_cases":["Cache expensive API calls or database queries with automatic expiry to balance freshness and performance.","Avoid recomputing long-running data transformations or ML model inference across multiple script runs.","Share cached results across different machines or processes using MongoDB, Redis, or S3 backends.","Implement fuzzy refresh: return stale cached values immediately while recalculating in the background.","Automatically clean up old cache entries on a schedule to prevent unbounded storage growth."],"what_it_does":"Cachier wraps Python functions with a decorator that persists their return values across program runs, avoiding redundant computation. It stores cached results using pluggable backends\u2014pickle files by default, but also MongoDB, SQL databases, Redis, S3, or in-memory storage\u2014and automatically invalidates stale entries based on a configurable time window. You can set per-function expiry times, trigger background recalculation of stale values without blocking, and globally enable or disable caching.\n\nThe package is designed for functions that take more than a second to execute; it adds roughly 1 millisecond of overhead per call. It handles both sync and async functions, supports thread-safe operation, and works across different Python sessions and machines (when using appropriate backends). Arguments must be hashable or you must provide a custom hash function. Instance methods are cached globally across all object instances, which can be a gotcha if methods depend on instance state.","worth_installing":"Yes. Cachier is actively maintained, has low install friction, carries no known vulnerabilities, and solves a common problem (avoiding redundant expensive function calls) with a simple decorator API. The MIT license is permissive. Choose it if you need persistent caching with expiry and backend flexibility; skip it if you only need transient in-memory caching (use functools.lru_cache instead)."},"id":"cachier","links":{"html":"https://skillfed.io/packages/cachier","md":"https://skillfed.io/packages/cachier.md","pypi":"https://pypi.org/project/cachier/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-03-26","license_spdx":null,"license_treatment":"permissive","name":"cachier","python_support":"supports_current","summary":"Persistent, stale-free, local and cross-machine caching for Python functions."},"popularity":{"monthly_downloads":156308,"position":10788,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"4.2.0"}
