arctool.archive

Module wrapping tar and gzip.

class arctool.archive.ArchiveDataSet(name)[source]

Class for creating specific archive datasets.

class arctool.archive.ArchiveFile[source]

Class for working with tarred/gzipped archive datasets.

Initialising using a dataset is used for creating archives, while initialising from a file is used for extracting and verifying.

classmethod from_file(path)[source]

Read archive from file, either .tar or .tar.gz

summarise()[source]

Return dictionary with summary information about an archive.

Returns:dictionary of summary information about the archive
verify_all()[source]

Verify all files in archive.

Returns:True if all files verify, False otherwise.
verify_file(file_in_archive)[source]

Verify single file in archive.

Parameters:file_in_archive – file to verify
Returns:True if checksum matches, False otherwise.
class arctool.archive.ArchiveFileBuilder[source]

Class for building up tarred archive datasets.

classmethod from_path(path)[source]

Return arctool.archive.ArchiveFileBuilder.

Parsed from a archive dataset directory.

persist_to_tar(path)[source]

Write archive dataset to tarball.

arctool.archive.compress_archive(path, n_threads=8)[source]

Compress the (tar) archive at the given path.

Uses pigz for speed.

Parameters:
  • path – path to the archive tarball
  • n_threads – number of threads for pigz to use
Returns:

path to created gzip file