s3transfer

Python library for managed, high-performance S3 file transfers

SDK
PyPI
v0.19.2
238stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
72/100Good
Development Activity80
Maintenance48
Community80
Maturity60
Momentum20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
79/100Good
Architecture83
Code Quality85
Innovation72
Learning Curve75

s3transfer is the library that implements the actual multipart upload/download logic behind boto3’s S3.Client.upload_file() and download_file() methods. It automatically decides when to split a transfer into multiple concurrent parts based on file size, retries failed parts, tracks progress via subscriber callbacks, and manages a thread pool so large-file transfers to/from S3 are fast and resilient without the caller having to implement any of that themselves.

Because every boto3 user already depends on it transitively, s3transfer is one of the most-downloaded packages in the Python ecosystem, even though most developers never import it directly — they interact with it through boto3.client('s3').

What You Get

  • A TransferManager that automatically chooses single-request vs. multipart transfer based on configurable size thresholds
  • Concurrent multipart upload/download with a bounded thread pool to control memory and connection usage
  • Automatic retry of failed parts without restarting the entire transfer
  • A Subscriber callback interface for progress reporting (bytes transferred, percentage complete)
  • Support for streaming uploads/downloads to and from file-like objects, not just filesystem paths

Common Use Cases

  • Uploading or downloading large files (backups, media, datasets) to/from S3 with automatic multipart handling
  • Building a CLI or GUI tool that needs upload progress bars via the subscriber callback interface
  • High-throughput data pipelines that move many large objects to/from S3 and need bounded concurrency to avoid saturating network or memory
  • Any boto3-based application indirectly relying on this library every time it calls upload_file/download_file/copy

Under The Hood

Architecture - Transfers are modeled as task graphs in tasks.py (390 lines): a submission task determines part boundaries and enqueues part-upload/download tasks onto a BoundedExecutor, with a completion task firing once all parts finish. upload.py (840 lines) and its download counterpart implement the actual multipart request logic against S3’s API.

Tech Stack - Pure Python with a dependency on botocore for the underlying S3 API calls; concurrency is implemented with Python’s standard concurrent.futures/threading rather than asyncio, since it needs to work synchronously inside boto3’s client model.

Code Quality - A large three-tier test suite (tests/unit, tests/functional, tests/integration) plus dedicated scripts/performance and scripts/stress directories for load-testing the transfer manager under concurrency — unusual rigor reflecting how much production traffic depends on this code path.

API Design - The public surface is deliberately narrow (upload, download, copy, delete, plus a Subscriber class for callbacks), matching boto3’s higher-level upload_file/download_file methods closely so most users never need to touch s3transfer’s API directly — its main audience is boto3 itself and tools building custom transfer logic on top.

Used by 5 apps in this directory

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search