Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

archivey

CI

Python library for reading, streaming, and safely extracting archives (ZIP, TAR, RAR, 7z, ISO, and more) through a unified interface.

Features

  • One interface for every format: ZIP, TAR (plain or compressed with gzip, bzip2, xz, zstd, lz4 or Unix compress), 7z, RAR, ISO 9660, plain directories, and single-file streams (gzip, bzip2, xz, lzip, LZMA, zstd, lz4, zlib, Brotli, Unix compress). List members, read one, or stream them all in one pass, the same way for each.
  • Automatic format detection from the file's content, so a misnamed file still opens.
  • Safe extraction by default: path traversal, symlink and hardlink escapes, special files and archive bombs are blocked unless you opt out.
  • Resource limits on listing size, decoder memory, password key-derivation work and temporary files, so a hostile archive fails with ResourceLimitError instead of exhausting the machine.
  • Verified reads: a member whose stored checksum fails raises CorruptionError, and the bad chunk is withheld. Reading past a truncation raises TruncatedError. Integrity errors come from reads, never from close().
  • Built for streaming: stream_members() hands out each member as a stream, in archive order and in one pass, so a solid 7z or RAR is decoded once and a large member is read in chunks rather than held in memory. TAR, ZIP and the single-file formats also read straight from a pipe.
  • Encrypted archives: ZipCrypto and WinZip AES in ZIP, AES in 7z, and RAR encryption.
  • Native 7z and RAR metadata readers. 7z data decodes in-process; RAR data needs RARLAB unrar or rar, or unar.
  • Zero-dependency core for ZIP, TAR, 7z with the common codecs, RAR listing, directories and the standard-library codecs, plus an archivey command for listing, testing and extracting from the shell.
  • Tested on Python 3.11 to 3.14 on Linux, and on 3.11 and 3.14 on macOS and Windows.

The API is not frozen until 1.0, but no major changes are expected.

Install and use

pip install archivey                 # zero-dependency core
pip install "archivey[recommended]"  # every format and codec that installs everywhere
import archivey

# Extract safely: traversal, link escapes and bombs are blocked by default.
with archivey.open_archive("untrusted.zip") as reader:
    reader.extract_all("out/")

# List and read members, whatever the format.
with archivey.open_archive("photos.tar.gz") as reader:
    for member, stream in reader.stream_members():
        if member.is_file:
            print(member.name, len(stream.read()))

Documentation

https://davitf.github.io/archivey/

Install · Opening an archive · Choosing how to read · Extracting · Security · Formats and extras · Migrating from other libraries · API reference

How it is built

Almost all of archivey's code, tests and documentation are written by AI coding agents (Claude Code and Cursor). The maintainer designs the library, makes the decisions, directs the work and reviews the code, especially the architecture and the tricky parts. Changes are tested on Linux, macOS and Windows and reviewed by a separate AI session that reads them from zero, and several reviews of the whole codebase hunt for bugs, unclear or dead code, and API problems. If you are wary of AI-written code, that is reasonable: How it is built says how changes are made and checked, and what the process does not promise.

Contributing and security

  • CONTRIBUTING.md — coding / testing standards
  • VISION.md — priorities and trade-offs; authoritative contracts live in openspec/specs/
  • SECURITY.md — private vulnerability reporting

Metadata

Release files for archivey 0.2.0rc1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for archivey 0.2.0rc1
File Size Uploaded Provenance Actions
archivey-0.2.0rc1.tar.gz 7.5 MB With provenance Details for archivey-0.2.0rc1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for archivey 0.2.0rc1
File Interpreter ABI Platform Actions
archivey-0.2.0rc1-py3-none-any.whl Python 3 none any Details for archivey-0.2.0rc1-py3-none-any.whl

Total release size: 8.7 MB

Release files / archivey-0.2.0rc1.tar.gz

Download URL archivey-0.2.0rc1.tar.gz
Size 7.5 MB
Tags Source
SHA-256 checksum
How to use checksums
dc6e544fb0fdc7c533c3251f364db85a53cb6fb064c4db12a8564e63de3c147c
BLAKE2b-256 checksum
How to use checksums
a0be9837c42a20abe35d578c7b2a08c3327d4497c334928871acad5407ee83de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Release files / archivey-0.2.0rc1-py3-none-any.whl

Download URL archivey-0.2.0rc1-py3-none-any.whl
Size 1.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
113b32f857c4c5446aea0de56b4d645dda22d0bc4527ff57a00fb7297ae8074b
BLAKE2b-256 checksum
How to use checksums
5bcde9ec5434f655f75b3ca6f591739b9483acefe3f872328044e1d8c69ef91c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Security for archivey 0.2.0rc1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for archivey-0.2.0rc1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page