zipp is the official backport of the pathlib-compatible zipfile.Path object from the Python standard library. It provides a Traversable/pathlib-like interface for navigating and reading ZIP archives (zipp.Path), with new features introduced here first and later merged into CPython. Current version is 3.23.0, released June 2025, with a very active cadence of roughly one release per month maintained by Jason R. Coombs (jaraco).
pip install zippVerified import paths — ran on the pinned version, not inferred.
Create an in-memory ZIP, wrap it with zipp.Path, iterate entries, read file content, and glob for files — all using a pathlib-style API.
Pass mode='rb' explicitly for binary reads. Remove any positional pwd argument; keyword args still pass through to io.TextIOWrapper.
Replace joinpath(add='sub/path') with joinpath('sub/path') or the / operator (root / 'sub' / 'path').Pin to zipp<3.20 if you must support Python 3.8. For Python 3.7, pin to zipp<3.5.
Use path.name (strips the slash) rather than str(path) when comparing directory names.
Do not rely on the original ZipFile object type after wrapping it in zipp.Path; use the zipp.Path interface exclusively for all navigation.
Filter results with item.is_file() when you want only files: [p for p in root.glob('**/*.txt') if p.is_file()].Declare a loose lower bound (zipp>=3.9) rather than an exact pin unless you have a specific compatibility reason.
No dependency data recorded yet.