--- id: securetar version: "2026.4.1" license: Apache-2.0 license_treatment: permissive maintenance: active --- # securetar — Python module to handle tarfile backups. License: permissive · Maintenance: active · Downloads: 577.3K/mo ## What it is and what it does Secure Tar is a Python library that extends the standard tarfile module with encryption and secure file handling. It provides a streaming wrapper around tarfile that lets you create encrypted tar archives and handle file backups securely. The library supports both plain and encrypted archives, optional gzip compression, and a pattern for nesting multiple tar files within an outer tar container—all without writing intermediate files to disk. The package depends on cryptography and PyNaCl for encryption operations and requires Python 3.11.0 or later. It's designed for backup workflows where you need to create encrypted archives programmatically, with a simple context-manager API that mirrors the standard tarfile interface. The library is actively maintained and has no known security vulnerabilities. Use it for: - Create encrypted backup archives of application data or configuration directories with a single API call. - Build nested backup structures (outer tar containing multiple inner compressed tars) without intermediate file writes. - Add file filtering during archive creation to exclude sensitive or temporary files from backups. - Automate secure backup pipelines that require encryption without managing raw cryptography details. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Secure Tar wraps Python's tarfile module to add encryption and secure file handling for tar archives, supporting both unencrypted and encrypted backup creation with optional compression. Yes. Secure Tar is a straightforward, actively maintained wrapper for encrypted tar backups with low install friction and no known vulnerabilities. Install it if you need to create encrypted tar archives in Python 3.11+ and want a simpler API than managing cryptography directly. The Apache-2.0 license poses no restrictions for most use cases. ## Install pip install securetar uv add securetar poetry add securetar ## Installing securetar Before you install: Low install friction with a pure-Python wheel. Active maintenance with a recent commit on 2026-07-29 and regular releases; currently at version 2026.4.1 released 2026-04-07. License in practice: Apache-2.0 is permissive, allowing commercial and private use with minimal restrictions; you may use, modify, and distribute this package freely as long as you include the license notice. Quickstart: pip install securetar from securetar import SecureTarFile, atomic_contents_add from pathlib import Path with SecureTarFile("backup.tar", "w", b"AES128_KEY_SIZE") as tar: atomic_contents_add(tar, Path("."), arcname=".") Requires Python 3.11.0 or later; cryptography and PyNaCl must be installed as runtime dependencies. Verify before relying: - Whether the encryption key size (e.g., 'AES128_KEY_SIZE') is validated or if arbitrary byte strings are accepted. - Performance characteristics when handling large archives or streaming very large files. - Whether atomic_contents_add supports recursive directory traversal by default or requires explicit configuration. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 577.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags encrypted tar archive, secure tarfile backup, encrypted file backup python, tar encryption wrapper, secure tar streaming, encrypted backup library, encryption, backup, archive [View on SkillFed](https://skillfed.io/packages/securetar) · [View on PyPI](https://pypi.org/project/securetar/)