File system based cache for resources & metadata. Compatible with BiocFileCache R package
Note: Package is in development. Use with caution!!
Package is published to PyPI
pip install pybiocfilecache
from pybiocfilecache import BiocFileCache
import os
bfc = BiocFileCache(cache_dir = os.getcwd() + "/cache")
Once the cache directory is created, the library provides methods to
add
: Add a resource or artifact to cacheget
: Get the resource from cacheremove
: Remove a resource from cacheupdate
: update the resource in cachepurge
: purge the entire cache, removes all files in the cache directory
(for testing use the temp files in the tests/data
directory)
rec = bfc.add("test1", os.getcwd() + "/test1.txt")
print(rec)
rec = bfc.get("test1")
print(rec)
rec = bfc.remove("test1")
print(rec)
rec = bfc.get("test1"m os.getcwd() + "test2.txt")
print(rec)
bfc.purge()
This project has been set up using PyScaffold 4.1. For details and usage information on PyScaffold see https://pyscaffold.org/.