keggtools.storage#
Storage of KEGG data. Caching downloaded files from API to local file system.
Classes#
Storage handler class. |
Module Contents#
- class keggtools.storage.Storage(cachedir=None)#
Storage handler class.
- Parameters:
cachedir (str | None)
- build_cache_path(filename)#
Build absolute filename for caching directory.
- cachedir = None#
- check_cache_dir()#
Checks if cache dir exist. Raises “NotADirectoryError” of caching folder not found.
- Raises:
NotADirectoryError – Error if cache folder does not exist.
- Return type:
None
- exist(filename)#
Check if filename exist in caching dir.
- load(filename)#
Load string from file.
- load_dump(filename)#
Load binary dump from file.
- save(filename, data)#
Save string as file in local storage. Returns absolute filename of save file.