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.2.0.tar.gz
(21.7 kB
view details)
Built Distribution
File details
Details for the file pyBiocFileCache-0.2.0.tar.gz
.
File metadata
- Download URL: pyBiocFileCache-0.2.0.tar.gz
- Upload date:
- Size: 21.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d63f4f5285ede93811091ae37336a9d7127f5ecce1df6bb802c80177d8966437 |
|
MD5 | 33a9e3990a841d2e9fd247495aef38a8 |
|
BLAKE2b-256 | a960f399afd74558c3aca514fa960859eb0a7f3d09e89dd1e17e87ae96ce1645 |
File details
Details for the file pyBiocFileCache-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: pyBiocFileCache-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fc838038936b84ae5e734496c704dde5689249c86e0325f808b1674c080a25f |
|
MD5 | 51ff6ec23b6bdb807e5e0965b9755ab7 |
|
BLAKE2b-256 | d7ce610c3c75c0ee89da8ee55b46d515ce9b4df839eb275222910008392b4a02 |