Skip to main content

File based cache for resources and metadata

Project description

Project generated with PyScaffold PyPI-Server Unit tests

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.3.0.tar.gz (23.8 kB view details)

Uploaded Source

Built Distribution

pyBiocFileCache-0.3.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file pybiocfilecache-0.3.0.tar.gz.

File metadata

  • Download URL: pybiocfilecache-0.3.0.tar.gz
  • Upload date:
  • Size: 23.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for pybiocfilecache-0.3.0.tar.gz
Algorithm Hash digest
SHA256 b7b2ddc32c9f58d21de7930f51dc9c50baa905c162f4a2ae66d999cf977b7ccc
MD5 0184426bac02ec2e2822ed6fe0e3e18b
BLAKE2b-256 18a69c6b9558638e4ec636b8d39fe57eca3a3eec7b416362f94467090079557c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyBiocFileCache-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9230f71646908e6b678c1a71a2e314895cd51c0df3231425b92331b76d8a3c95
MD5 dbe4dfcc98f61de72b4e358f5684f2de
BLAKE2b-256 ed541be6d89fd5375de6315cfe041024c614f9c04046162fc597b4c9ee583e38

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