### RemoteZip Command Line Usage Source: https://github.com/gtsystem/python-remotezip/blob/master/README.md Displays the help message and available arguments for the remotezip command-line tool. Use this to understand the basic syntax and options. ```bash usage: remotezip [-h] [-l] [-d DIR] url [filename [filename ...]] Unzip remote files positional arguments: url URL of the zip archive filename File to extract optional arguments: -h, --help show this help message and exit -l, --list List files in the archive -d DIR, --dir DIR Extract directory, default current directory ``` -------------------------------- ### List Members in Archive Source: https://github.com/gtsystem/python-remotezip/blob/master/README.md Iterates through and prints the filename of each member within a remote zip archive. Ensure the URL points to a valid zip file. ```python from remotezip import RemoteZip with RemoteZip('http://.../myfile.zip') as zip: for zip_info in zip.infolist(): print(zip_info.filename) ``` -------------------------------- ### Download a Specific Member from Archive Source: https://github.com/gtsystem/python-remotezip/blob/master/README.md Extracts a single specified file ('somefile.txt') from a remote zip archive. The archive must be accessible via the provided URL. ```python from remotezip import RemoteZip with RemoteZip('http://.../myfile.zip') as zip: zip.extract('somefile.txt') ``` -------------------------------- ### List Files in Remote Zip Archive Source: https://github.com/gtsystem/python-remotezip/blob/master/README.md Lists the files contained within a remote zip archive. This command fetches the central directory to display file names, sizes, and modification times. ```bash $ remotezip -l "http://thematicmapping.org/downloads/TM_WORLD_BORDERS-0.3.zip" Length DateTime Name -------- ------------------- ------------------------ 2962 2008-07-30 13:58:46 Readme.txt 24740 2008-07-30 12:16:46 TM_WORLD_BORDERS-0.3.dbf 145 2008-03-12 13:11:54 TM_WORLD_BORDERS-0.3.prj 6478464 2008-07-30 12:16:46 TM_WORLD_BORDERS-0.3.shp 2068 2008-07-30 12:16:46 TM_WORLD_BORDERS-0.3.shx ``` -------------------------------- ### Download Member from S3 Hosted Zip Archive Source: https://github.com/gtsystem/python-remotezip/blob/master/README.md Demonstrates downloading a file from a zip archive hosted on AWS S3 using authentication and specific headers. Requires the 'aws-requests-auth' library. ```python from aws_requests_auth.boto_utils import BotoAWSRequestsAuth from hashlib import sha256 auth = BotoAWSRequestsAuth( aws_host='s3-eu-west-1.amazonaws.com', aws_region='eu-west-1', aws_service='s3' ) headers = {'x-amz-content-sha256': sha256('').hexdigest()} url = "https://s3-eu-west-1.amazonaws.com/.../file.zip" with RemoteZip(url, auth=auth, headers=headers) as z: zip.extract('somefile.txt') ``` -------------------------------- ### Extract Specific File from Remote Zip Archive Source: https://github.com/gtsystem/python-remotezip/blob/master/README.md Extracts a specified file from a remote zip archive to the current directory. This command performs at least two requests: one for the central directory and one for the requested file. ```bash $ remotezip "http://thematicmapping.org/downloads/TM_WORLD_BORDERS-0.3.zip" Readme.txt Extracting Readme.txt... ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.