An efficient, secure, and deterministic TAR streaming engine.
Project description
TarTape
TarTape is a TAR archive generation engine designed with a focus on streaming and explicit control over the archiving process.
Most TAR tools are unpredictable; their headers grow and shrink. TarTape follows a golden rule: Every file header measures exactly 512 bytes.
Whether you are archiving a small text file or a 10 Terabyte database dump, the structure remains constant. This makes your stream mathematically predictable, allowing you to calculate offsets and resume interrupted uploads with byte-precision.
Installation
pip install tartape
Usage Examples
1. Basic Streaming
The simplest way to use TarTape. Emits events that you can pipe anywhere.
from tartape import TarTape, TarEventType
tape = TarTape()
tape.add_folder("./my_dataset")
with open("backup.tar", "wb") as f:
for event in tape.stream():
if event.type == TarEventType.FILE_DATA:
f.write(event.data)
2. Resuming an Interrupted Stream
Because TarTape uses a deterministic inventory, you can resume a multi-terabyte upload if it fails at the 50th file.
tape = TarTape(index_path="manifest.db") # The inventory is persistent
tape.add_folder("./massive_dataset")
# If the previous run failed at 'video_042.mp4'...
for event in tape.stream(resume_from="massive_dataset/video_042.mp4"):
# This skips the header/body of finished files and continues
# from the very next byte of the next file.
upload_to_cloud(event.data)
3. Professional Monitoring
TarTape acts as a "White Box", letting you see exactly what's happening.
for event in tape.stream():
match event.type:
case TarEventType.FILE_START:
print(f"Archiving: {event.entry.arc_path} at offset {event.metadata.start_offset}")
case TarEventType.FILE_END:
# Integrity check: Each file reports its calculated MD5 during the stream
print(f"Done: {event.entry.arc_path} | Hash: {event.metadata.md5sum}")
case TarEventType.TAPE_COMPLETED:
print("Stream finished successfully.")
Observable Events
You can react to the following events:
| Event Type | Description | Metadata Available |
|---|---|---|
FILE_START |
Before emitting a file header | start_offset, entry |
FILE_DATA |
Raw bytes (Header, Body, or Padding) | data |
FILE_END |
After file is fully processed | end_offset, md5sum |
TAPE_COMPLETED |
After the 1024-byte TAR footer | - |
Technical Constraints & Defaults
- Path Length: Maximum 255 characters (to maintain the 512-byte header contract).
- File Types: Supports Files, Directories, and Symlinks. Sockets, Pipes, and Devices are ignored.
- Anonymization (Default: On): By default, it scrubs local UID/GIDs and usernames to ensure privacy and hash consistency across different environments. This can be disabled if local identity preservation is required.
- Format: Uses GNU TAR format extensions for large file support (>8GiB).
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tartape-1.6.0.tar.gz.
File metadata
- Download URL: tartape-1.6.0.tar.gz
- Upload date:
- Size: 16.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dfa26ad27da98c3f98bb105e3e61b9b554ef1877665b4bef98d8445800d571ac
|
|
| MD5 |
7e8999211cabaed2ccdecadd16974cb7
|
|
| BLAKE2b-256 |
f89fd02c0865f62aa2b4d197616af08c063c57191f84bd9fb180aad0adabba56
|
Provenance
The following attestation bundles were made for tartape-1.6.0.tar.gz:
Publisher:
publish.yml on CalumRakk/tartape
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tartape-1.6.0.tar.gz -
Subject digest:
dfa26ad27da98c3f98bb105e3e61b9b554ef1877665b4bef98d8445800d571ac - Sigstore transparency entry: 889398748
- Sigstore integration time:
-
Permalink:
CalumRakk/tartape@6286748b60f074429c532090d2f41159df942d74 -
Branch / Tag:
refs/tags/v1.6.0 - Owner: https://github.com/CalumRakk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6286748b60f074429c532090d2f41159df942d74 -
Trigger Event:
push
-
Statement type:
File details
Details for the file tartape-1.6.0-py3-none-any.whl.
File metadata
- Download URL: tartape-1.6.0-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0d6b2c1803c23149c70738dab3e04fe677b24f58cdabcb0c5b8e4eb3b718fd8
|
|
| MD5 |
558472f4fbb8020cf3cf612884dfeb66
|
|
| BLAKE2b-256 |
3537ce710ac0e955cc2a5e55ae751d8617b834149bbd78f8aacc4108e984db74
|
Provenance
The following attestation bundles were made for tartape-1.6.0-py3-none-any.whl:
Publisher:
publish.yml on CalumRakk/tartape
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tartape-1.6.0-py3-none-any.whl -
Subject digest:
d0d6b2c1803c23149c70738dab3e04fe677b24f58cdabcb0c5b8e4eb3b718fd8 - Sigstore transparency entry: 889398786
- Sigstore integration time:
-
Permalink:
CalumRakk/tartape@6286748b60f074429c532090d2f41159df942d74 -
Branch / Tag:
refs/tags/v1.6.0 - Owner: https://github.com/CalumRakk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6286748b60f074429c532090d2f41159df942d74 -
Trigger Event:
push
-
Statement type: