Skip to content

archivey 0.2.0rc1

Pre-release
Pre-release

Choose a tag to compare

@davitf davitf released this 18 Oct 16:39
· 319 commits to main since this release
1a4034b

Release candidate for 0.2.0, to test the release flow. Install with
pip install --pre archivey.

First public release. This repository is a rewrite: the earlier v1 / alpha line
(previously published from what is now
davitf/archivey-old) is a separate codebase
with no compatibility promise. Treat 0.2.0 as the first release of this library.

The public API is not frozen until 1.0: minor releases before then may still change it,
and each change will be listed here. No major changes are expected.

Added

  • One interface for reading, streaming and extracting archives. open_archive()
    returns a reader that lists members, reads one member, or streams them all in one pass,
    the same way for every format.
  • Formats: ZIP, TAR (plain and compressed: gzip, bzip2, xz, zstd, lz4, Unix
    compress), 7z, RAR (1.5 through RAR5), ISO 9660 (Joliet, Rock Ridge, zisofs), plain
    directories, and single-file streams (gzip, bzip2, xz, lzip, LZMA, zstd, lz4, zlib,
    Brotli, Unix compress). Self-extracting archives are read behind their stub.
  • Automatic format detection from the file's content, with the extension as the last
    signal, so a misnamed file still opens.
  • Native 7z and RAR metadata readers. Listing a 7z or RAR needs no third-party
    package. 7z data decodes in-process, BCJ2 included. RAR data needs RARLAB unrar or
    rar, or unar.
  • Encrypted archives: ZipCrypto and WinZip AES in ZIP, AES in 7z (headers too),
    and RAR3/RAR5 encryption, with one password or a list of candidates.
  • Safe extraction by default. extract_all() blocks path traversal, symlink and
    hardlink escapes, special files and deceptive names, and caps total size, compression
    ratio and entry count. Three policies (STRICT, STANDARD, TRUSTED) set how much
    to allow.
  • Resource limits beyond extraction: caps on listing size, decoder memory,
    password key-derivation work and temporary spool files, all on ArchiveyConfig, and
    all raising ResourceLimitError.
  • 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 and the single-file formats also read
    from a non-seekable source. The documented access costs say which operations re-read
    or re-decompress.
  • Verified reads. A member whose CRC or other checksum fails, or that ends short,
    raises from read(). Codec errors map to one ArchiveyError hierarchy, and
    non-fatal oddities are reported as structured diagnostics that
    DiagnosticPolicy.STRICT turns into errors.
  • Zero-dependency core. ZIP, TAR, directories and the standard-library codecs need
    no extra packages. [recommended] adds the other codecs, crypto and ISO;
    [seekable] adds the rapidgzip accelerator; [free-threaded] is the GIL-safe set.
  • The archivey command: list, test, extract (with the same safety defaults) and
    inspect archives from the shell.
  • Tested on Python 3.11 to 3.14 on Linux, macOS and Windows, plus free-threaded 3.13t on
    Linux.

Security