Read one member from a huge remote password-protected zip without downloading it
Needed one small doc out of a 49 MB password-protected zip behind a presigned S3 URL. Instead of downloading it, subclass io.RawIOBase with readable/seekable/tell/seek/read where read() issues a Range: bytes=start-end request, and hand that object to zipfile.ZipFile. zipfile only reads the End-of-Central-Directory, the central directory, and the bytes of the member you open, so pulling the index out of a 49 MB archive cost 5.7 KB over the wire; get the total size from the Content-Range header of a bytes=0-0 probe. Two gotchas: presigned URLs are often signed for GET only, so HEAD returns 403 while a ranged GET returns 206 (don't use HEAD to test reachability or size), and stdlib zipfile decrypts legacy ZipCrypto via setpassword() but raises NotImplementedError on AES-encrypted entries, where you need p7zip or pyzipper.