DataCache
Download a dataset once, verify it, and reuse the local file on later runs. DataCache handles streaming downloads, gzip/ZIP decompression, tar-tree installation, offline inspection and SQLite caches built from pandas DataFrames, for Python applications including OpenVax libraries such as pyensembl.
Install
Python 3.11 or newer is required; CI tests Python 3.11–3.14.
python -m pip install datacache
# Optional HTML-table conversion:
python -m pip install "datacache[html]"
Quickstart
Download a file once, then reuse its local path on later calls:
from datacache import Cache
cache = Cache("my-project")
url = "https://raw.githubusercontent.com/openvax/datacache/master/LICENSE"
path = cache.fetch(url, filename="LICENSE", timeout=30)
print(path)
# Reuses the cached file without a network request, even in a later process.
assert cache.fetch(url, filename="LICENSE") == path
Replace the URL and filename with your dataset. Existing files are reused until
you refresh them with force=True, or periodically with expire_after;
DataCache doesn't ask the server whether a file has changed. Add
show_progress=True to display a download bar; no extra installation is needed.
Guides
The guides are also published at https://openvax.github.io/datacache/.
- Working offline example, verification and interface choices
- Downloads, inspection, integrity, freshness, retries and resumption
- Tables, SQLite and transformations
- Shared caches
- Progress and logging
- Pinned bundles, archive trees and the fixed-path file registry
- Interface selection and guarantees
- Derived-artifact materialization: caller-owned builders, outputs published together as one bundle, dependency receipts and resumable inputs.
- Complete API reference
- Individual HTTP ZIP members: bounded range downloads with compressed and expanded checksums.
- Downstream integration: contracts for consuming libraries.
- Release notes and release procedure.
Dependencies and progress display
tqdm is installed by default; existing download APIs enable displays with
show_progress=True, while materialize enables them by default. Quiet use
does not import tqdm or configure your application's logging. The old
datacache[progress] install syntax remains supported as a compatibility alias.
The existing pandas dependency range is unchanged; upgrading DataCache does not introduce a pandas 1.5 requirement. CI covers pandas 1.4.4, 1.5.3, and current releases on supported Python versions.
Development
python -m pip install -e ".[test]"
./lint-and-test.sh
python -m examples.basic_usage
Tests use local files, mocked responses, and local HTTP servers. They do not depend on external dataset servers. See CI for the Python, dependency, and operating-system combinations exercised.
Build the site with python -m pip install -r requirements-docs.txt and ./docs.sh.
License
Apache 2.0; see LICENSE.
Metadata
Release files for datacache 1.30.0
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 |
|---|---|---|---|---|
| datacache-1.30.0.tar.gz | 299.8 kB | Without provenance | Details for datacache-1.30.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| datacache-1.30.0-py3-none-any.whl | Python 3 | none | any | Details for datacache-1.30.0-py3-none-any.whl |
Total release size: 414.9 kB
Release files / datacache-1.30.0.tar.gz
| Download URL | datacache-1.30.0.tar.gz |
|---|---|
| Size | 299.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7f2c746fe4be7c56f57091ca2f4ad735c5631584f18015ded3c1bd557462c06b
|
|
BLAKE2b-256 checksum How to use checksums |
0318bf20c943de144f9eea8ae3590e48537cfa3627fed9b286ba0db2b77f1abe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Release files / datacache-1.30.0-py3-none-any.whl
| Download URL | datacache-1.30.0-py3-none-any.whl |
|---|---|
| Size | 115.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2540f05320b691f5a99b9c7b96b3db5a24ef88fcdbe3aea6e4ac123ee7dc344f
|
|
BLAKE2b-256 checksum How to use checksums |
38106f0a4d9ec4a0fd1383233be696b319ac27d4358c37bc8daa5013ecaa8af1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Security for datacache 1.30.0
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.