Python module to handle tarfile backups.
Project description
Secure Tar
Secure Tarfile library
It's a streaming wrapper around python tarfile and allow secure handling files and support encryption.
with SecureTarFile("test.tar", "w") as tar_file:
atomic_contents_add(
tar_file,
temp_orig,
excludes=[],
arcname=".",
)
with SecureTarFile("test.tar", "w", b"AES128_KEY_SIZE") as tar_file:
atomic_contents_add(
tar_file,
temp_orig,
excludes=[],
arcname=".",
)
A common pattern is to create an outer uncompressed tarfile that contains a variety of inner tar files. This can be accomplished without writing out multiple files with the following pattern.
outer_secure_tar_file = SecureTarFile("pkg.tar", "w", gzip=False)
with outer_secure_tar_file as outer_tar_file:
with outer_secure_tar_file.create_inner_tar(
"./backup1.tar.gz", gzip=True
) as inner_tar_file:
atomic_contents_add(
inner_tar_file,
path_1,
excludes=[],
arcname=".",
)
with outer_secure_tar_file.create_inner_tar(
"./backup2.tar.gz", gzip=True
) as inner_tar_file:
atomic_contents_add(
inner_tar_file,
path_2,
excludes=[],
arcname=".",
)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
securetar-2024.2.1.tar.gz
(11.1 kB
view hashes)
Built Distribution
Close
Hashes for securetar-2024.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc7e5b8f44080f45945f5e12ff7e10e5c957c00283c947c9fbcb27d00a8955fc |
|
MD5 | 4dd60a1cad9b140a732522366b33b110 |
|
BLAKE2b-256 | 8bb49542bb4dd066827f839ba39b0d279b348aedd60e984eeeac9773bbf2dd6f |