"""Streams uploaded documents from arbitrary S3 buckets to local disk (ADR-0060). Uploaded files live across many source buckets (each `uploaded_files` row carries its own `s3_file_bucket`), so — unlike the bucket-bound `S3Client` — this takes the bucket per call. Downloading to a file (rather than reading the object into memory) keeps a single multi-GB member off the heap when it is added to the on-disk ZIP. """ from __future__ import annotations from typing import Any class S3DocumentDownloader: def __init__(self, boto_s3_client: Any) -> None: self._client = boto_s3_client def download(self, bucket: str, key: str, dest_path: str) -> None: self._client.download_file(Bucket=bucket, Key=key, Filename=dest_path)