Skip to content

additional checks for an archive.pooch_hash file in lieu of the archive - #549

Open
J-Wall wants to merge 1 commit into
fatiando:mainfrom
J-Wall:delete_after_extraction
Open

additional checks for an archive.pooch_hash file in lieu of the archive#549
J-Wall wants to merge 1 commit into
fatiando:mainfrom
J-Wall:delete_after_extraction

Conversation

@J-Wall

@J-Wall J-Wall commented Jul 16, 2026

Copy link
Copy Markdown

Proposed changes

Added checks in pooch.core.download_action for a file named f"{fname}.pooch_hash" which, if present, allows the archive file itself to be deleted (without triggering subsequent re-downloads). The .pooch_hash files contain:

On the first line, separated by a space " ":

  • The hash of the archive file
  • The name of the archive file (although this can also be inferred from the filename itself, it is included for consistency with the rest of the file)

On subsequent lines, also separated by a space, with one line per extracted member of the archive:

  • The hash of extracted file
  • The path of the extracted file, relative to the cache directory

Why

I added this because I want to use pooch to download large archives (GB range), but I'm only interested in a processed extract of those archives (100MB range), and I would rather not waste disk space with holding onto an archive file I don't need.

I have tried to design the functionality to be in the spirit of the existing pooch code. e.g. enabling integrity checking of processed files via storing their hash in the placeholder file.

Relevant issues/PRs:

Fixes #158

…actual file being there, along with delete_after_extraction option to processors
@J-Wall J-Wall changed the title Added additional checks for a archive.pooch_hash file in lieu of the … additional checks for an archive.pooch_hash file in lieu of the archive Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Delete archives, retain the extracted files, and don't re-download

1 participant