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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyBiocFileCache-0.4.1-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

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

Hashes for pybiocfilecache-0.4.1.tar.gz
Algorithm Hash digest
SHA256 16102fffbc176090548e710e8b64118b90bc3685e82f9f2d4c4e064df23efab9
MD5 3d70aedf5bc74a6f9d8a0359199de780
BLAKE2b-256 7400e9fecbca87c279a01661d188e03b71052d9149ec2d1c5e4eee4b3e8aff7b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyBiocFileCache-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a2d669342a1dbf705159a7181fad6e1f96578aa261e80b90219fb00bc3aff377
MD5 a329c05d63b0dfc55de7299eba73d71a
BLAKE2b-256 8af3a4a45e2a7e78dfc953856d011f71394fa89d0a163c08258f0f7dc2fe0dcf

See more details on using hashes here.

Supported by

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