2024-08-01 22:03:59 +00:00
|
|
|
|
<a id="daisy-based-cache"></a>
|
|
|
|
|
|
2024-08-01 01:09:11 +00:00
|
|
|
|
# Daisy based cache
|
|
|
|
|
|
|
|
|
|
### *class* Daisy.Cache.Cache(filepaths=None, cacheFile=None, path: str = 'daisy', walk: bool = False, isCatch: bool = False)
|
|
|
|
|
|
|
|
|
|
In memory collection of Daisy records
|
|
|
|
|
|
2024-08-01 22:03:59 +00:00
|
|
|
|
[🔗 Source](https://git.utopic.work/PierMesh/piermesh/src/branch/main/Daisy/Cache.py)
|
|
|
|
|
|
2024-08-01 01:09:11 +00:00
|
|
|
|
#### create(path: str, data: dict)
|
|
|
|
|
|
|
|
|
|
Create new record
|
|
|
|
|
|
|
|
|
|
* **Parameters:**
|
|
|
|
|
* **path** (*str*) – Path to create record at
|
|
|
|
|
* **data** (*dict*) – Data to populate record with
|
|
|
|
|
|
|
|
|
|
#### get(path: str)
|
|
|
|
|
|
|
|
|
|
Get record at path, else return False
|
|
|
|
|
|
|
|
|
|
path: str
|
|
|
|
|
: Path of record
|
|
|
|
|
|
|
|
|
|
#### refresh()
|
|
|
|
|
|
|
|
|
|
Reload from disk to memory
|
|
|
|
|
|
|
|
|
|
#### search(keydict: dict, strict: bool = True)
|
|
|
|
|
|
|
|
|
|
Search cache for record for records with values
|
|
|
|
|
|
|
|
|
|
keydict: dict
|
|
|
|
|
: Values to search for
|
|
|
|
|
|
|
|
|
|
strict: bool
|
|
|
|
|
: Whether to require values match
|