File based cache for resources and metadata
Project description
pyBiocFileCache
File system based cache for resources & metadata. Compatible with BiocFileCache R package
Note: Package is in development. Use with caution!!
Installation
Package is published to PyPI
pip install pybiocfilecache
Initialize a cache directory
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
Add a resource to cache
(for testing use the temp files in the tests/data
directory)
rec = bfc.add("test1", os.getcwd() + "/test1.txt")
print(rec)
Get resource from cache
rec = bfc.get("test1")
print(rec)
Remove resource from cache
rec = bfc.remove("test1")
print(rec)
Update resource in cache
rec = bfc.get("test1"m os.getcwd() + "test2.txt")
print(rec)
purge the cache
bfc.purge()
Note
This project has been set up using PyScaffold 4.1. For details and usage information on PyScaffold see https://pyscaffold.org/.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pybiocfilecache-0.3.1.tar.gz
(24.0 kB
view hashes)
Built Distribution
Close
Hashes for pyBiocFileCache-0.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59499dcaa451eb94e161621a96c6e70bf544288a14d5f90f339c48acdbf0bf41 |
|
MD5 | 001fc94f29591e103a882a7c666ec792 |
|
BLAKE2b-256 | e69dbb4889456eb5f922fa7480dfc438e7fbc10bbbf86f27254d126560551c09 |