Tar Utilities Python Module

Utilities and classes for unbundling and archiving a tar file.

class pacifica.ingest.tarutils.FileIngester(hashtype, hashcode, file_id)[source]

Class to ingest a single file from a tar file into the file archives.

__init__(hashtype, hashcode, file_id)[source]

Constructor for FileIngester class.


list of weak references to the object (if defined)


Read wrapper for requests that calculates the hashcode inline.

upload_file_in_file(info, tar)[source]

Upload a file from inside a tar file.


Validate that the calculated hash matches the hash uploaded in the tar file.

exception pacifica.ingest.tarutils.HashValidationException[source]

Class to capture hashsum validation failures.


list of weak references to the object (if defined)

class pacifica.ingest.tarutils.MetaParser[source]

Class used to hold and search metadata.




list of weak references to the object (if defined)


clean /data from filepaths.


Count the file objects in metadata and keep the count.


Get the file name from the file ID.


Return the hash string for a file name.


Get the sub directory element from the file ID.

load_meta(tar, job_id)[source]

Load the metadata from a tar file into searchable structures.


Upload metadata to server.

read_meta(metafile, job_id)[source]

Read the metadata from metafile and assume it’s good.

class pacifica.ingest.tarutils.TarIngester(tar, meta)[source]

Class to read a tar file and upload it to the metadata and file archives.

__init__(tar, meta)[source]

Constructor for TarIngester class.


list of weak references to the object (if defined)


Ingest a tar file into the file archive.


Retrieve the file count for a tar file.

Does not count metadata.txt as that is not uploaded to the file archive


Return a file path with the data separator removed.


Seek to the location of fpath, returns a file stream pointer and file size.


Patch the files in the archive interface.