Skip to main content

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 cache
  • get: Get the resource from cache
  • remove: Remove a resource from cache
  • update: update the resource in cache
  • purge: 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.2.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

pyBiocFileCache-0.2.2-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file pyBiocFileCache-0.2.2.tar.gz.

File metadata

  • Download URL: pyBiocFileCache-0.2.2.tar.gz
  • Upload date:
  • Size: 22.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for pyBiocFileCache-0.2.2.tar.gz
Algorithm Hash digest
SHA256 34e7150ff945f4f04fd4a6686e6741ec11b7d0ad92dd710fa4faa2e9bc0102de
MD5 99e464ad3ec1cf26ee4f7b8546eb1812
BLAKE2b-256 29242cb03c38e8caec07660258bcc3c7d235187df804486f85f18c5b63ac25a6

See more details on using hashes here.

File details

Details for the file pyBiocFileCache-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for pyBiocFileCache-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bbcf5b3c530b9499610dc271573000826bbe0ce519b4b25a9b539a68df024295
MD5 be8574049be7658e849539e6aeeda6ae
BLAKE2b-256 563411789535c1928263410ca0baf0b67cad7d56ce781f938857b9d523f0794d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page