lair.records.Cacher#

class lair.records.Cacher(func, cache_file, reload=False)[source]#

Bases: object

A class that caches function results to a file for future use.

Parameters:
func#

The function to be cached.

Type:

function

cache_file#

The name of the file to cache results to.

Type:

str

reload#

Whether to reload the cache index from the index file.

Type:

bool

pkl = <module 'pickle' from '/usr/lib/python3.12/pickle.py'>#
load_cache_index()[source]#

Loads the cache index from a file.

Returns:

dict – A dictionary of cached results and their corresponding file positions.

save_cache_index()[source]#

Saves the cache index to a file.