:orphan: :mod:`snowmobile.core.cache` ============================ .. py:module:: snowmobile.core.cache .. autoapi-nested-parse:: Simple caching implementation for `snowmobile.toml` location. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: snowmobile.core.cache.Cache .. class:: Cache Bases: :class:`snowmobile.core.Generic` Bare bones caching implementation for configuration file locations. .. attribute:: file_nm Name of file storing cached paths; defaults to `snowmobile_cache.json`. :type: str .. attribute:: cache_dir Path to cache directory within AppData. :type: Path .. attribute:: location Full path to `snowmobile_cache.json`. :type: Path .. attribute:: contents Cache contents (file path by file name). :type: Dict .. attribute:: file_nm Configuration file name; defaults to `snowmobile_cache.json`. :type: str .. attribute:: cache_dir Cache directory. :type: pathlib.Path .. attribute:: location Full path to `snowmobile_cache.json`. :type: pathlib.Path .. attribute:: contents :annotation: :Dict Cached contents. :type: Dict .. method:: save(self) -> ContextManager[Cache] Writes changes to disk when exiting context of other methods. .. method:: save_item(self, item_name: str, item_value) Caches `item_value` to be retrieved by `item_name`. .. method:: save_all(self, items: Dict) Caches a dictionary of items .. method:: as_path(self, item_name: str) -> pathlib.Path Utility to return `item_name` as a :class:`Path` object. .. method:: clear(self, item: [List, str]) Clears an item or a list of items from the cache by name. .. method:: contains(self, item: Union[(List, str)]) -> bool Checks if an item or list of items exist in the cache. .. method:: get(self, item: str) Fetch an item from contents.