{"categories":[{"label":"Libraries","url":"https://skillfed.io/packages/category/software-development-libraries/8"}],"enrichment":{"capability":"Caching library for async Python applications that prevents cache stampede (dog-piling) and provides a configurable, extensible API for memoizing expensive async function calls.","skillfed_tags":["asyncio","cache-stampede","memoization"],"use_cases":["Memoize expensive async API calls or database queries in asyncio services to reduce latency and backend load","Prevent cache stampede in high-concurrency async applications where multiple tasks would otherwise recompute the same result simultaneously","Cache results with tunable background refresh to serve stale data while updating in the background, avoiding request latency spikes","Implement custom cache storage (e.g., Redis, Memcached) by extending the provided storage and serialization interfaces","Decorate Tornado async handlers to cache computed responses across concurrent requests"],"what_it_does":"py-memoize is a caching library designed specifically for asynchronous Python code\u2014both asyncio and Tornado\u2014that solves the cache stampede (dog-piling) problem where multiple concurrent tasks simultaneously miss the cache and flood the underlying resource. It wraps expensive async functions with a decorator to cache and reuse their results, and includes built-in protections against concurrent cache misses.\n\nThe library is highly configurable: you can tune cache timeouts, key generation strategies, storage backends, eviction policies (least-recently-updated by default), and value post-processing (including optional deep-copy). It supports background cache refreshing with separate update and expiration delays, allowing stale values to be refreshed asynchronously without observable latency. All components are extensible, so you can plug in custom storage, key extraction, or eviction logic.","worth_installing":"Yes, if you are building async Python services and need protection against cache stampede. The library is stable and has no known vulnerabilities, but note that maintenance is dormant (676 days since last release)\u2014verify compatibility with your target Python version and async framework before adopting. For simple in-memory caching in active projects, consider whether the dormancy risk is acceptable."},"id":"py-memoize","links":{"html":"https://skillfed.io/packages/py-memoize","md":"https://skillfed.io/packages/py-memoize.md","pypi":"https://pypi.org/project/py-memoize/"},"maintenance":{"status":"dormant"},"meta":{"latest_release":"2024-10-07","license_spdx":null,"license_treatment":"permissive","name":"py-memoize","python_support":"unspecified","summary":"Caching library for asynchronous Python applications (both based on asyncio and Tornado) that handles dogpiling properly and provides a configurable & extensible API."},"popularity":{"monthly_downloads":182579,"position":10093,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"3.1.1"}
