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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pybiocfilecache-0.4.1.tar.gz.
File metadata
- Download URL: pybiocfilecache-0.4.1.tar.gz
- Upload date:
- Size: 24.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
16102fffbc176090548e710e8b64118b90bc3685e82f9f2d4c4e064df23efab9
|
|
| MD5 |
3d70aedf5bc74a6f9d8a0359199de780
|
|
| BLAKE2b-256 |
7400e9fecbca87c279a01661d188e03b71052d9149ec2d1c5e4eee4b3e8aff7b
|
File details
Details for the file pyBiocFileCache-0.4.1-py3-none-any.whl.
File metadata
- Download URL: pyBiocFileCache-0.4.1-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2d669342a1dbf705159a7181fad6e1f96578aa261e80b90219fb00bc3aff377
|
|
| MD5 |
a329c05d63b0dfc55de7299eba73d71a
|
|
| BLAKE2b-256 |
8af3a4a45e2a7e78dfc953856d011f71394fa89d0a163c08258f0f7dc2fe0dcf
|