An attempt at implementing a Python version of the BiocFileCache R package
Can be used as a cache interface for any file based system
Note: Package is in development. Use with caution!!
PyPI - https://pypi.org/project/pyBiocFileCache/
pip install pyBiocFileCache
from pybiocfilecache import BiocFileCache
import os
bfc = BiocFileCache(cache_dir = os.getcwd() + "/cache")
Once the cache directory is created, the library allows
- Create a resource -
add
- Get a resource from cache -
get
- Remove a resource -
remove
- update a resource -
update
- purge the entire cache -
purge
(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/.