NetZip
NetZip is a Rust library and CLI tool that allows you to work with remote ZIP files over HTTP without downloading the entire archive. It uses HTTP range requests to efficiently fetch only the parts of the ZIP file that are needed.
Features
- 🚀 Network Efficient - Download only the parts of the ZIP file you need
- 📋 List Files - View the contents of a remote ZIP file
- 📦 Extract Files - Download specific files from a remote ZIP
- 🧩 Library & CLI - Use as a library in your Rust projects or as a command-line tool
Installation
From Cargo
From Source
The binary will be available at ./target/release/netzip_cli
.
CLI Usage
List Files in a Remote ZIP
# or with the shorter alias
This will display a table with file paths, compressed sizes, and uncompressed sizes.
Extract Files from a Remote ZIP
# Extract specific files
# or with the shorter alias
Library Usage
Add to your Cargo.toml
:
[]
= "0.1.0"
= "0.12.15"
= { = "1.44.1", = ["full"] }
Example: List Files in a ZIP
use RemoteZip;
async
Example: Extract Specific Files
use RemoteZip;
use fs;
async
How It Works
NetZip uses a three-step process to efficiently access files in a remote ZIP archive:
- Fetch End of Central Directory - First, it downloads just the end of the ZIP file to locate the Central Directory.
- Download Central Directory - It then downloads only the Central Directory, which contains metadata about all files in the archive.
- Extract Specific Files - Finally, it downloads only the parts of the archive that contain the requested files.
This approach minimizes bandwidth usage, making it ideal for working with large ZIP files when you only need specific contents.
Supported Compression Methods
- Stored (uncompressed)
- Deflate
- Deflate64
Project Structure
- netzip_parser: Low-level ZIP format parser
- netzip: Main library for HTTP-based ZIP access
- netzip_cli: Command-line interface
License
LGPLv3