research_helpers.archive
Provides byte-reproducible archives and checksums for data deposits and submissions.
- research_helpers.archive.digest(path, algorithm=DEFAULT_ALGORITHM)[source]
Return the hex digest of a file, read in blocks.
- research_helpers.archive.normalise(info, mtime=EPOCH)[source]
Strip host-specific metadata from an archive member.
- research_helpers.archive.write_archive(archive, members, *, mtime=EPOCH, compress_level=DEFAULT_COMPRESS_LEVEL)[source]
Write a gzipped tar whose bytes depend only on its contents and member names.
- Parameters:
- Return type:
- Returns:
The archive written.
- research_helpers.archive.archive_directory(archive, source, *, mtime=EPOCH, compress_level=DEFAULT_COMPRESS_LEVEL)[source]
Write every file under ‘source’ to a reproducible archive, named relative to it.
- Parameters:
- Return type:
- Returns:
The archive written.
- research_helpers.archive.write_checksums(paths, destination, algorithm=DEFAULT_ALGORITHM)[source]
Write a checksum file in the format ‘shasum -c’ and ‘sha256sum -c’ read.
Names are written relative to the checksum file, which is the directory a verifier runs in:
cd dist && shasum -a 256 -c SHA256SUMS