This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the user guide for the big picture.


class biolearn.cache.LocalFolderCache(path, max_size_gb)#

A cache that stores data as serialized objects in a local directory. Implements basic LRU (Least Recently Used) cleanup to maintain the cache within a specified maximum size limit.

__init__(path, max_size_gb)#

Initializes the LocalFolderCache instance.

  • path (str) – The filesystem path to the directory to be used for cache storage.

  • max_size_gb (float) – The maximum size of the cache in gigabytes.


Retrieves an item from the cache by its key, if it exists.


key (str) – The key for which the cache value is retrieved.


The value stored in the cache, or None if the key does not exist or an error occurs.

Return type:


store(key, value)#

Stores an item in the cache under the specified key, managing the cache size to stay within limits.

  • key (str) – The key under which the value is stored.

  • value (any) – The value to be stored.


Clears the cache by removing the cache directory and all its contents.