speasy.core.cache.cache module
- class speasy.core.cache.cache.Cache(cache_path: str = '', cache_type: str = 'Cache')[source]
Bases:
object- cache_file
- cache_type
- drop_matching_entries(pattern: str | Pattern)[source]
Drop all cache entries that match a given pattern
- Parameters:
- patternstr or re.Pattern
The pattern to match cache keys against
- transact(key: str | None = None)[source]
Open a transaction context.
For a single Cache the
keyargument is ignored. For a FanoutCache the transaction is per-shard andkeyselects the shard — atomicity only applies within that shard, so all operations in the block must target the same shard key.
- property version
- speasy.core.cache.cache.delete_migration_backups() List[str][source]
Delete legacy diskcache backups left over from migrating to sciqlop-cache.
Safe to call at any time: only removes the
<path>.diskcache.backupdirectories created by the one-time migration, never a live cache.- Returns:
- List[str]
Paths that were actually deleted.