Skip to main content

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

Uploaded Source

Built Distribution

pyBiocFileCache-0.0.1-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyBiocFileCache-0.0.1.tar.gz
  • Upload date:
  • Size: 21.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pyBiocFileCache-0.0.1.tar.gz
Algorithm Hash digest
SHA256 52dde0b21184052e5ed5d83e929dd1430e8830bed0927ec1f6f552b619968f71
MD5 351b120f9625903c305ab752eddb07ef
BLAKE2b-256 c3f36590d05479b5051a0a716d70f8b2490becd3380eba621ecbf02ecf3e22d1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyBiocFileCache-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pyBiocFileCache-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d0a68450e5832cf2cbabd4ab20293fe234b4889dfc7b04723a27e256d690fc76
MD5 5600194abed509078b2767d9aa710e88
BLAKE2b-256 901a88f8bbe074e7b7af7f3d6aecac55c1dc4fbfb11ea2c606d70304be892aab

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