pyBiocFileCache
pyBiocFileCache is a Python package that provides a file caching system with resource validation, expiration management, and SQLite-backed metadata. Compatible with the 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 datetime import timedelta
from pathlib import Path
from pybiocfilecache import BiocFileCache, CacheConfig
# 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
from datetime import datetime, timedelta, timezone
# Add file with expiration
resource = cache.add(
"myfile",
"path/to/file.txt",
expires=datetime.now(timezone.utc) + timedelta(days=30),
)
# Immediate lookup without waiting on missing files
record = cache.get(rid="BFC1", wait=False)
# List resources
resources = cache.list_resources()
# Search resources (exact or substring match)
results = cache.search("myfile", field="rname")
# Update resource by name or rid
cache.update("myfile", "path/to/new_file.txt")
cache.update(rid="BFC1", fpath="path/to/new_file.txt")
# Remove resource by name or rid
cache.remove("myfile")
Cache Statistics and Maintenance
# Get cache statistics
stats = cache.get_stats()
print(stats)
# Clean up expired resources
removed_count = cache.cleanup()
# Verify integrity of cached files
valid, invalid = cache.verify_cache()
# Purge entire cache
cache.purge()
Metadata
Release files for pybiocfilecache 0.8.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pybiocfilecache-0.8.1.tar.gz | 26.7 kB | With provenance | Details for pybiocfilecache-0.8.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pybiocfilecache-0.8.1-py3-none-any.whl | Python 3 | none | any | Details for pybiocfilecache-0.8.1-py3-none-any.whl |
Total release size: 41.8 kB
Release files / pybiocfilecache-0.8.1.tar.gz
| Download URL | pybiocfilecache-0.8.1.tar.gz |
|---|---|
| Size | 26.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
93930322c72a2dfbeb79bd0b2a6ac7ebceaabc08bded586d46eaeb9c8355e5dd
|
|
BLAKE2b-256 checksum How to use checksums |
f8f8d867987b1b3e9fc9d7d8030adf70e8acfe29e12684ce93d6713a2c5f830e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logRelease files / pybiocfilecache-0.8.1-py3-none-any.whl
| Download URL | pybiocfilecache-0.8.1-py3-none-any.whl |
|---|---|
| Size | 15.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
757a2992b4ec0951ab6a028d61531f33f2ac107d1bf57f35e92f37b52f7172dc
|
|
BLAKE2b-256 checksum How to use checksums |
7bdb0de2a7765d37f435af620b67a60d9c808bb896d2cad084364244720faa5a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logSecurity for pybiocfilecache 0.8.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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for pybiocfilecache-0.8.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logA 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.