Archive formats · compression algorithms · columnar storage · Python APIs · verified 2026

Data archival & compression

Package, shrink, and preserve data for the long haul. Bundle with tar/zip; compress with the right algorithm for the job — gzip for compatibility, xz for max ratio, zstd for the modern speed/ratio sweet spot, lz4 when speed is everything. For analytics data, reach for columnar formats (Parquet/ORC) that compress far better than row files. This sheet pairs CLI tools with their Python APIs — including Python 3.14's new compression.zstd.

archive formats compression algorithms Python APIs columnar & cold storage integrity & practice gotcha most common

Verified 2026-08-31 against GNU coreutils/tar, zstd/xz/lz4 docs, the CPython stdlib (incl. PEP 784's compression.zstd, new in 3.14), and Apache Parquet/ORC/Avro specs. tar bundles; the algorithm compresses — two separate jobs a single command often does at once.

Outline

Bundle files (tar/zip), pick a compressor by the speed-vs-ratio tradeoff, drive it all from Python, and choose durable formats for analytics & cold storage — always with a checksum.

Formats & algorithms

  1. 1tar — bundle files
  2. 2zip & the classics
  3. 3zstd — the modern default
  4. 4xz, lz4, brotli

Python APIs

  1. 5gzip / bz2 / lzma
  2. 6tarfile & zipfile
  3. 7compression.zstd (3.14)
  4. 8shutil archives

Columnar & durability

  1. 9Parquet / ORC / Avro
  2. 10Choosing an algorithm
  3. 11Cold storage & lifecycle
  4. 12Integrity & practice

Archive Formats & Algorithms

Bundle with tar/zip; compress with the algorithm that fits.

1tar — bundle filestape archive
2zip & the classicsgzip · bzip2
3zstd — the modern defaultZstandard
4xz, lz4, brotlithe specialists

Python APIs

Every major format has a stdlib module — including the new compression package.

5gzip / bz2 / lzmastdlib compressors
6tarfile & zipfilebundles in Python
7compression.zstdPython 3.14 · PEP 784
8shutil archivesone-liners

Columnar Storage & Durability

Formats built for analytics, cold storage, and provable integrity.

9Parquet / ORC / Avrodata-lake formats
10Choosing an algorithmthe tradeoff
11Cold storage & lifecycletiering
12Integrity & practicetrust the bytes

Worth memorizing

tar -czf a.tar.gz dir/create · -xzf extract · -tf list
tar --zstd / -cJfzstd / xz compressed tarball
zstd -19 · --ultra -22modern default; -T0 all cores
xz -9max ratio, slow · lz4 = fastest
gzip -k-k keeps original (else deleted!)
gzip.open / compresssame API in bz2, lzma
from compression import zstdstdlib zstd, new in 3.14
tarfile extractall(filter="data")block tarbombs
shutil.make_archivegztar/zip/xztar one-liner
to_parquet(compression="zstd")columnar beats CSV
access pattern picks codecxz cold · lz4 hot · zstd default
sha256sum -cverify; compress THEN encrypt