python script to extract files from remote ZIP archives without downloading the entire archive
Project description
cloud_unzip
python script to extract files from remote ZIP archives without downloading the entire archive
Installation
pip install cloud_unzip
Usage
usage: cloud_unzip [-h] [-l] [-t] [-e EXTRACT] [-o OUTPUT] [-p] [-w WORKERS] url
Extract files from remote ZIP archives
positional arguments:
url URL of the remote ZIP file
options:
-h, --help show this help message and exit
-l, --list List files in the ZIP archive
-t, --tree Display zip contents in tree format
-e, --extract EXTRACT Extract specific files from the ZIP archive (comma-separated)
-o, --output OUTPUT Output directory for extracted files. Use "-" to write to stdout
-p, --parallel Extract files in parallel
-w, --workers <n> Maximum number of worker threads for parallel extraction
To extract a single file
cloud_unzip -e path/to/file/inside/zip <url>
To extract Multiple files
- Enter file paths comma separated
cloud_unzip -e path/to/file1,path/to/file2,path/to/file3 <url>
( use --parallel to extract multiple files parallely , default extraction method is sequential )
Limitations
- Server must support range request
- only
DeflateandStoremethods are currently supported
Use as module
- Example
from cloud_unzip import RemoteZipExtractor
url = "https://example.com/yourfile.zip"
extractor = RemoteZipExtractor(url)
# List files in the ZIP archive
files = extractor.list_files()
print("Files in zip:", files)
# Extract a specific file
extracted_path = extractor.extract_file("docs/readme.txt", output_path="readme.txt")
print(f"Extracted to: {extracted_path}")
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cloud_unzip-0.1.1.tar.gz
(6.6 kB
view details)
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 cloud_unzip-0.1.1.tar.gz.
File metadata
- Download URL: cloud_unzip-0.1.1.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2d0251e52b6feb797c46e5868253c9d84be956877c7ba245b0793db47bcb659
|
|
| MD5 |
2a1adffa5a6856c6e5c10b8dd1107ac4
|
|
| BLAKE2b-256 |
a655ad725a6b7db259e228b2b6b33e7b9352d95e7729e59066674b935df8fd48
|
File details
Details for the file cloud_unzip-0.1.1-py3-none-any.whl.
File metadata
- Download URL: cloud_unzip-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b6c6fdb54d23f6babf092ddacc2a58226bceb13819ac0bf35f42b994c7e851a
|
|
| MD5 |
233eadfb460d38d1c2124d0a15bb613a
|
|
| BLAKE2b-256 |
cb57a4ece1714ac5b94d9f862d8a8c27160930b33f1d068f58ab236be4b3fcf4
|