Skip to main content

Project generated with PyScaffold PyPI-Server Unit tests

pyBiocFileCache

pyBiocFileCache is a Python package that provides a robust file caching system with resource validation, cache size management, file compression, and resource tagging. Compatible with BiocFileCache R package.

Installation

Install from PyPI,

pip install pybiocfilecache

Quick Start

from pybiocfilecache import BiocFileCache

# Initialize cache
cache = BiocFileCache("path/to/cache/directory")

# Add a file to cache
resource = cache.add("myfile", "path/to/file.txt")

# Retrieve a file from cache
resource = cache.get("myfile")

# Use the cached file
print(resource.rpath)  # Path to cached file

Advanced Usage

Configuration

from pybiocfilecache import BiocFileCache, CacheConfig
from datetime import timedelta
from pathlib import Path

# Create custom configuration
config = CacheConfig(
    cache_dir=Path("cache_directory"),
    cleanup_interval=timedelta(days=7),
)

# Initialize cache with configuration
cache = BiocFileCache(config=config)

Resource Management

# Add file with tags and expiration
from datetime import datetime, timedelta

resource = cache.add(
    "myfile",
    "path/to/file.txt",
    tags=["data", "raw"],
    expires=datetime.now() + timedelta(days=30)
)

# List resources by tag
resources = cache.list_resources(tag="data")

# Search resources
results = cache.search("myfile", field="rname")

# Update resource
cache.update("myfile", "path/to/new_file.txt")

# Remove resource
cache.remove("myfile")

Cache Statistics and Maintenance

# Get cache statistics
stats = cache.get_stats()
print(stats)

# Clean up expired resources
removed_count = cache.cleanup()

# Purge entire cache
cache.purge()

Metadata

Release files for pybiocfilecache 0.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pybiocfilecache 0.6.1
File Size Uploaded Provenance Actions
pybiocfilecache-0.6.1.tar.gz 28.2 kB Without provenance Details for pybiocfilecache-0.6.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pybiocfilecache 0.6.1
File Interpreter ABI Platform Actions
pyBiocFileCache-0.6.1-py3-none-any.whl Python 3 none any Details for pyBiocFileCache-0.6.1-py3-none-any.whl

Total release size: 40.4 kB

Release files / pybiocfilecache-0.6.1.tar.gz

Download URL pybiocfilecache-0.6.1.tar.gz
Size 28.2 kB
Tags Source
SHA-256 checksum
How to use checksums
36627366c640e05b2912a9b7745749af1f665c84dd7c39a79a61e50aca12f078
BLAKE2b-256 checksum
How to use checksums
97f36384ca3a695428a519d392dfbaa267a5c28bb288ce122d8e5bc6e60acc10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.7

Release files / pyBiocFileCache-0.6.1-py3-none-any.whl

Download URL pyBiocFileCache-0.6.1-py3-none-any.whl
Size 12.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f2cf268b4b796aec5a22d7974a2316556bc4e4494a43126222291db9034edd1e
BLAKE2b-256 checksum
How to use checksums
94fdbe5f6cadfe2458de9e3c1cb21078cd3139fd4c738b6e198172c291b23e62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.7

Security for pybiocfilecache 0.6.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page