imf_reader.cache.dataframe ========================== .. py:module:: imf_reader.cache.dataframe .. autoapi-nested-parse:: DataFrameCache decorator for disk-backed persistent caching of function results. Wraps a function to cache its return value under //. DataFrame results are stored as parquet; everything else as pickle. The wrapped function exposes .cache_clear() (zero-arg, returns None) and allows arbitrary attribute assignment on the wrapper (e.g. fetch_data.last_version_fetched = ...). Attributes ---------- .. autoapisummary:: imf_reader.cache.dataframe.logger Functions --------- .. autoapisummary:: imf_reader.cache.dataframe.dataframe_cache Module Contents --------------- .. py:data:: logger .. py:function:: dataframe_cache(*, ttl: datetime.timedelta, sublayer: str) -> Any Decorator factory that caches a function's return value to disk. :param ttl: How long cached results are valid. :param sublayer: Subdirectory under the cache root (e.g. "weo_api", "sdr"). :returns: Decorator that wraps the target function.