Python move all compression and archive related library together with unified API

Currently, there are zlib, lzma, tarfile zipfile, … they exist as independent modules. Each of them has their own API.

It would be nice to collect them together like hashlib, And provide unified API between different algorithm.

This can be more friendly to beginner and reduce learning cost.

This already exists: shutil — High-level file operations — Python 3.11.4 documentation

2 Likes

An improvement idea: tarfile should expose supported formats · Issue #58221 · python/cpython · GitHub

shutil doesn’t provide a unified API for working with compressed file-like objects, which I think is more like what the OP is suggesting