(self, key: str)
| 34 | self.base.mkdir(parents=True, exist_ok=True) |
| 35 | |
| 36 | def _path_for(self, key: str) -> Path: |
| 37 | digest = hash_key(key) |
| 38 | return self.base / digest[:2] / f"{digest}.json" |
| 39 | |
| 40 | def load(self, key: str, *, ttl: int) -> Optional[Dict]: |
| 41 | path = self._path_for(key) |