Windows cabinet (.cab) file reader
Project description
cabfile
Read Windows .cab archives with a small, practical API.
The modern API is centered on CabFile and two helpers:
CabFile(source)for member listing, reading, and extractionis_cabinet(source) -> boolfor safe type checksprobe(source) -> CabSummaryfor fast cabinet-level metadata
Quick start
import cabfile
with cabfile.CabFile("archive.cab") as cab:
print(cab.namelist())
payload = cab.read("hello.txt")
print(cabfile.is_cabinet("archive.cab"))
summary = cabfile.probe("archive.cab")
print(summary.file_count)
API shape
CabFile exposes two complementary layers:
- Member-centric methods for metadata + payload workflows:
read_members(names=None)extract_members(target_dir, names=None)
- ZipFile-compatible methods/properties for drop-in usage patterns:
read,extract,extractall,namelist,infolist,getinfo,printdir,filelist,NameToInfo
CLI
The package includes a ZipFile-style CLI via the cabfile script or python -m cabfile.
# List archive members
cabfile -l archive.cab
# Test archive readability
cabfile -t archive.cab
# Extract all members to target directory
cabfile -e archive.cab output_dir
Note: Exit codes are process-style:
0success1test command found unreadable archive data2usage or cabinet read error
Compatibility
Note: This project uses ctypes with Windows cabinet.dll APIs.
It is intended for Windows environments.
Note: CAB decryption/password handling is not supported.
ZipFile-shaped pwd parameters are accepted for compatibility but raise NotImplementedError when provided.
Background
Based on the Microsoft Cabinet SDK API surface (FDI), with compatibility ideas borrowed from zipfile.py.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cabfile-2.0.0rc1.tar.gz.
File metadata
- Download URL: cabfile-2.0.0rc1.tar.gz
- Upload date:
- Size: 38.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.5 {"installer":{"name":"uv","version":"0.10.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cfb8f6b23b55477e62c3755bfcbddef0d230fcd6b5d5c51271d12538b29d9a67
|
|
| MD5 |
8f808aa7469946fe638c1247b1085031
|
|
| BLAKE2b-256 |
351a8afaf369ab9fa04f36ff47a93367cfe1e6fdd9fff40d71aa5b564e91e3a6
|
File details
Details for the file cabfile-2.0.0rc1-py3-none-any.whl.
File metadata
- Download URL: cabfile-2.0.0rc1-py3-none-any.whl
- Upload date:
- Size: 16.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.5 {"installer":{"name":"uv","version":"0.10.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0e709e93f4f56e58174081b6c7be71bd410fb71dbe8b4a10e48a6e30d6f79cd
|
|
| MD5 |
b742abed7519b38fce5ef58eb087c4a1
|
|
| BLAKE2b-256 |
63595001d15c21c967faeee12f80d558acc28f875ee74cacaff458806852771f
|