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
Release history Release notifications | RSS feed
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.11.0.tar.gz
(11.1 kB
view details)
Built Distribution
File details
Details for the file securetar-2024.11.0.tar.gz
.
File metadata
- Download URL: securetar-2024.11.0.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2191d8c8234777bba287a9b3e8a16cd3ec78fb52d092d1ef1b57d14c81d6838d |
|
MD5 | 644023a6bfe59be2c6782a4130230a10 |
|
BLAKE2b-256 | 8cc546fc614b4d23823d90fd34b9f41dd649ebf639fc9581c7828eb05f0bd2df |
File details
Details for the file securetar-2024.11.0-py3-none-any.whl
.
File metadata
- Download URL: securetar-2024.11.0-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e538dc403b1773f33a58d3ef5fa71ab14c51f060b784924b3745eb6b0b27bfaa |
|
MD5 | e319ccea9e3403e4aeaf4fb413464a38 |
|
BLAKE2b-256 | 98cc82943abb46b97c1b476d3c4c2b86b9601862f31c79b468fafa2fc76a4f25 |