Source code for speasy.core.index.speasy_index

import diskcache as dc

from speasy.config import index as index_cfg


[docs] class SpeasyIndex: def __init__(self): self._index = dc.Index(index_cfg.path())
[docs] def get(self, module, key, default=None): return self._index.get(f'{module}/{key}', default)
[docs] def set(self, module, key, value): self._index[f'{module}/{key}'] = value
[docs] def pop(self, module, key): return self._index.pop(f'{module}/{key}')
[docs] def contains(self, module, key): return f'{module}/{key}' in self._index