DataCache
Download, verify, transform, and cache datasets for Python applications, including OpenVax libraries such as pyensembl. DataCache provides streaming downloads, gzip/ZIP decompression, transactional tar-tree installation, reusable local paths, offline inspection, and SQLite caches built from pandas DataFrames.
Install
Python 3.9 or newer is required.
python -m pip install datacache
# Optional HTML-table conversion:
python -m pip install "datacache[html]"
tqdm is installed by default; progress displays are opt-in with
show_progress=True. Normal 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.
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
Sections that earlier versions of this README contained now live in these guides; their old links land on the guide that replaced them.
- 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 legacy file registry
- Interface selection and guarantees
- Complete API reference
- Downstream integration: contracts for consuming libraries.
- Release notes and release procedure.
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.
Metadata
Release files for datacache 1.18.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 | |
|---|---|---|---|
| datacache-1.18.1.tar.gz | 187.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| datacache-1.18.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 264.5 kB
Release files / datacache-1.18.1.tar.gz
| Download URL | datacache-1.18.1.tar.gz |
|---|---|
| Size | 187.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ba2edbd8e6c3a8d705c337f163586b1472a4ec64d02b83782f611b5597e15b92
|
|
BLAKE2b-256 checksum How to use checksums |
00ff875c69fb49b05517d8d6b67a024c320742068a589b144ad6d9aee3887a70
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.6
|
Release files / datacache-1.18.1-py3-none-any.whl
| Download URL | datacache-1.18.1-py3-none-any.whl |
|---|---|
| Size | 76.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
db117949ae4cde19b5a920eeeeed01039b3867369d07b19d9661c3f6e774b70a
|
|
BLAKE2b-256 checksum How to use checksums |
205e6d2e463c51a1fd3ed205c6c3c1cf75bd0fcee1378c403ff79e54f73ac828
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.6
|