{"categories":[{"label":"Libraries","url":"https://skillfed.io/packages/category/software-development-libraries/10"},{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/22"},{"label":"Utilities","url":"https://skillfed.io/packages/category/utilities/12"}],"enrichment":{"capability":"cachettl provides LRU TTL cache decorators for both synchronous and asynchronous functions, with configurable size limits, type-aware caching, and cache statistics tracking.","skillfed_tags":["caching","asyncio","decorator"],"use_cases":["Cache expensive function results for a fixed duration to reduce redundant computation in web services or data processing pipelines.","Monitor cache hit/miss ratios and TTL expiration timing via cache_info() to optimize caching parameters.","Add TTL caching to async I/O-bound functions (e.g., API calls, database queries) without blocking.","Implement type-aware caching for functions that accept arguments of different types and should treat them as distinct cache keys.","Replace functools.lru_cache when you need automatic expiration rather than unbounded or LRU-only eviction."],"what_it_does":"cachettl is a decorator library that adds time-limited caching to Python functions. It wraps both synchronous and asynchronous functions with an LRU (Least Recently Used) cache that automatically expires entries after a configurable TTL (time-to-live) in seconds. The cache can optionally be bounded by size, and supports type-aware argument caching so that f(3) and f(3.0) are cached separately if desired.\n\nThe package provides two decorator variants: the full @cachettl and @async_cachettl decorators expose cache_info() (which returns hits, misses, maxsize, currsize, and remainingttl) and cache_clear() methods; the minimal @cachettl_min and @async_cachettl_min variants omit these introspection features. It is pure Python with no external dependencies, making it lightweight to install and use in any Python 3.7+ environment.","worth_installing":"Yes, with conditions. The package is stable, MIT-licensed, and has no known vulnerabilities. It fills a genuine niche: simple TTL caching with asyncio support and cache introspection. However, maintenance is dormant (last commit July 2024, no updates since), so adopt it only if you accept that bug fixes or feature requests may not be addressed. For production use in a team, verify that the dormant status aligns with your risk tolerance."},"id":"cachettl","links":{"html":"https://skillfed.io/packages/cachettl","md":"https://skillfed.io/packages/cachettl.md","pypi":"https://pypi.org/project/cachettl/"},"maintenance":{"status":"dormant"},"meta":{"latest_release":"2024-07-06","license_spdx":null,"license_treatment":"permissive","name":"cachettl","python_support":"supports_current","summary":"cachettl is an elegant LRU TTL cache decorator that also works with asyncio. It has the cache_info(), cache_clear() methods and access to the remainingttl property."},"popularity":{"monthly_downloads":74399,"position":14844,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"1.0.4"}
