Skip to main content

An efficient, secure, and USTAR-compatible 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.

It is built for environments where generating a full TAR file in memory or via temporary disk files is not feasible or desirable—such as data pipelines, web services, or resource-constrained systems.

Rather than replacing traditional TAR tools, TarTape offers a predictable and observable alternative for scenarios where data flow integrity is paramount.

Leer versión en español (Spanish)


Key Features

  • True Data Streaming
    Generates a continuous byte stream, facilitating integration into pipelines where the final file doesn't need to reside on disk (e.g., direct cloud uploads).

  • Memory Efficiency
    RAM consumption remains low and constant, regardless of the total archive size. This allows for processing massive data volumes predictably.

  • Observability
    Unlike a "black box," TarTape emits events throughout the process. You can monitor exactly which file is being processed and react in real-time.

  • Integrity First
    The engine verifies that files do not change size while being read (e.g., active logs). If a discrepancy is detected, it raises an explicit error to prevent silent archive corruption.


Installation

pip install git+https://github.com/CalumRakk/tartape.git

Usage Examples

Basic Usage: Generate a TAR file

In the simplest case, TarTape emits the TAR file bytes as a stream that can be written directly to a file.

from tartape import TarTape, TarEventType

tape = TarTape()
tape.add_folder("./my_data")

with open("backup.tar", "wb") as f:
    for event in tape.stream():
        if event.type == TarEventType.FILE_DATA:
            f.write(event.data)

Streaming with Monitoring and Control

TarTape exposes the archiving process through events, allowing you to observe what happens at each stage of the stream.

from tartape import TarTape, TarEventType

tape = TarTape()
tape.add_folder("/var/log/app")

for event in tape.stream():
    if event.type == TarEventType.FILE_START:
        # Emitted before processing a file
        print(f"Archiving: {event.entry.arc_path} ({event.entry.size} bytes)")

    elif event.type == TarEventType.FILE_DATA:
        # Raw TAR bytes (headers, content, and padding)
        # These can be sent directly to a network socket or a bucket
        pass

    elif event.type == TarEventType.FILE_END:
        # Emitted when a file is finished
        # Includes metadata like the MD5 hash calculated during the read
        print(f"File completed. MD5: {event.metadata.md5sum}")

    elif event.type == TarEventType.TAPE_COMPLETED:
        print("TAR archive completed successfully.")

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

tartape-1.5.0.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tartape-1.5.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file tartape-1.5.0.tar.gz.

File metadata

  • Download URL: tartape-1.5.0.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tartape-1.5.0.tar.gz
Algorithm Hash digest
SHA256 2e32d99709f5d0dc5823dc00eec15dcd527eba15d51dbc5d1924504c3eb997aa
MD5 ea470ec2cdfea5fe552eeea7529d07be
BLAKE2b-256 aee4dd884a028fd6da5276cf6308f6cdd763b529c0fc9bf1fe7df253901ef7aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for tartape-1.5.0.tar.gz:

Publisher: publish.yml on CalumRakk/tartape

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tartape-1.5.0-py3-none-any.whl.

File metadata

  • Download URL: tartape-1.5.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tartape-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0d612e869546f6fe05bf730afaab0a9f66475cc40dad20a47a0f36e5f79597cb
MD5 ebff75ba16f3c7d5abff0393b9a43269
BLAKE2b-256 77d74dd38a99cbcedfff87bae4b0ce04d8850e68681c6e4533c6618223194e61

See more details on using hashes here.

Provenance

The following attestation bundles were made for tartape-1.5.0-py3-none-any.whl:

Publisher: publish.yml on CalumRakk/tartape

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page