vcorelib.io.archive
index
/home/vkottler/src/vkottler/workspace/vcorelib/vcorelib/io/archive/__init__.py

A module for extracting and creating arbitrary archives.

 
Package Contents
       

 
Functions
       
extractall(src: Union[pathlib.Path, str, NoneType], dst: Union[pathlib.Path, str, NoneType] = None, maxsplit: int = 1, **extract_kwargs) -> Tuple[bool, int]
Attempt to extract an arbitrary archive to a destination. Return whether or
not this succeeded and how long it took.
is_within_directory(directory: Union[pathlib.Path, str, NoneType], target: Union[pathlib.Path, str, NoneType]) -> bool
Determine if a target path is within the provided directory.
make_archive(src_dir: pathlib.Path, ext_str: str = 'tar.gz', dst_dir: pathlib.Path = None, **archive_kwargs) -> Tuple[Optional[pathlib.Path], int]
Create an archive from a source directory, named after that directory,
and optionally moved to a destination other than the parent directory
for the source. The extension specifies the kind of archive to create.
 
Return the path to the created archive (if it was created) and how long
it took to create.
safe_extract(tar: tarfile.TarFile, path: Union[pathlib.Path, str, NoneType] = None, **kwargs) -> None
Sanity check that all members will fall within the destination path.