Skip to content

cache

Functions:

  • file_cache

    Chaches function, if 'forever' is True, cache will never expire (and 'expire_in_seconds' will be ignored).

Attributes:

Attributes

cachedir module-attribute

cachedir = get(
    "HUT_SERVICE_CACHE_DIR",
    join(gettempdir(), "py_file_cache"),
)

default_seconds module-attribute

default_seconds = int(
    get("HUT_SERVICE_EXPIRE_SECONDS", 3600 * 24 * 2)
)

forever_seconds module-attribute

forever_seconds = int(3600 * 24 * 365 * 10)

T module-attribute

T = TypeVar('T')

clear_file_cache module-attribute

clear_file_cache = clear

Cleares cache.

Functions

file_cache

file_cache(
    func: None | Callable = None,
    ignore: Sequence = [],
    expire_in_seconds: int = default_seconds,
    forever: bool = False,
) -> Any

Chaches function, if 'forever' is True, cache will never expire (and 'expire_in_seconds' will be ignored).