tar¶
TAR I/O module.
Classes
- class TarReader[source]¶
Bases:
object
Safe TAR reader
- class TarWriter[source]¶
Bases:
object
Safe TAR writer.
- static check(path, overwrite=False)[source]¶
Checks that a file has of the correct extension and verifies that we can overwrite it if it exists.
- Parameters:
path (
Union
[str
,Path
]) – Path to the file.overwrite (bool)
- Returns:
- static write(dictionary, path, overwrite=False, verbose=True)[source]¶
Write a TAR archive of the dictionary, each key/value represents a single path name and associated file.
- Parameters:
dictionary (
Dict
[str
,Any
]) – Dictionary to be archived.path (
Union
[str
,Path
]) – Path to the file.overwrite (
bool
) – Whether to overwrite, in case of an existing file.verbose (
Union
[bool
,int
]) – Verbosity of the method.
- Returns: