v1.6.0
What's Changed
- Improve cache by @jm-rivera in #34
- Adds
use_raw_cache=Falsetobulk_download_crs,download_crs_file,bulk_download_dac2a
andbulk_download_multisystemfor the cases where you want to bypass the bulk cache and
re-download fresh on every call. Caching remains on by default. - Adds a typed
BulkPayloadCorruptError(importable fromoda_reader) for the rare case
where a freshly downloaded zip arrives corrupt. The corrupt entry is removed before the
exception is raised, so the next call cleanly re-downloads. The error message tells you
what to do next. - Strengthens corruption detection by validating freshly downloaded zips end-to-end (full
member CRC check), not just the central directory. Cached files are trusted on hit so
this doesn't slow normal use. - The bulk cache now self-maintains: it keeps the two most recent downloads per dataset
and evicts older ones, and sweeps stale temp files left behind by interrupted downloads
(older than 24h) on startup. No more manually clearing the cache directory to free space. - Temp-file naming now includes the hostname alongside the PID, preventing collisions when
the cache directory lives on a shared / NFS mount used by multiple machines. clear_cache,set_cache_dir,enable_cacheanddisable_cachenow emit a
DeprecationWarningfor users who also importoda_data, pointing at the umbrella
oda_data.cache.*API. Standaloneoda_readerusers see no warning. The shims continue
to work through the1.xseries and will be removed in2.0.- Cache directory is now versioned by the installed package version (via
importlib.metadata) rather than a hardcoded string, so upgrades automatically invalidate old caches that may contain partial or corrupt downloads from prior versions. - Bulk-download cache writes are now atomic: downloads stream into a sibling temp file and are only renamed over the destination on success, so partial downloads no longer pollute the cache on interruption or error.
- On
BadZipFile, the corrupt cached archive is removed so the next call cleanly re-downloads instead of looping on the same poisoned entry. - Cached archives are validated with
zipfile.is_zipfilebefore reuse; a corrupt entry is removed and re-downloaded transparently.
Full Changelog: v1.5.1...v1.6.0