Python implementation of the BiocFileCache mechanism
Project description
pyBiocFileCache
An attempt at implementing a Python version of the BiocFileCache R package
Note: Package is in development. Use with caution!!
Description
Installation
Note: Package is not on PyPI yet.
pip install git+https://github.com/epiviz/pyBiocFileCache
Create a cache directory
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
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.0.2.tar.gz
(21.4 kB
view hashes)
Built Distribution
Close
Hashes for pyBiocFileCache-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9d96f2b37502a3b296393d6e6440be16e5299e4876f08ed957cccdb88135d6b |
|
MD5 | 460a7cd31da4314c75d397bc5b3d820d |
|
BLAKE2b-256 | cf3ec6c329ac15e454b15bc849545ee65215e17f00dcaa695ee3fbe1a5845487 |