nook.cache

A tiny on-disk cache for remote responses.

Reproducibility matters more than cleverness here: a calculation that pulled levels last March should be able to pull the identical bytes today, and a cached tree can be committed alongside a paper’s input decks.

nook.cache.default_cache_dir()[source]

$NOOK_CACHE, else the XDG cache directory.

class nook.cache.Cache(directory=None, enabled=True)[source]

Bases: object

Content-addressed key/value store over plain files.

get(key)[source]
put(key, value)[source]
clear()[source]

Delete every cached entry; returns the number of files removed.