s3hop - Cross-account S3 bucket streaming copy
A command-line tool to efficiently copy files between S3 buckets across different AWS accounts.
Features
- Copy files between S3 buckets across different AWS accounts
- Smart file comparison to only copy new or updated files
- Progress tracking with ETA and transfer speed
- Detailed transfer summary with file type statistics
- Handles large files and directories efficiently using streaming
- Preserves file structure between source and destination
Quick Start
# Install
pip install s3hop
# Use
s3hop source-profile s3://source-bucket/prefix/ dest-profile s3://dest-bucket/prefix/
Installation
You can install this package directly from PyPI:
pip install s3hop
Or install from source:
git clone https://github.com/thehamsti/s3hop.git
cd s3hop
pip install .
Prerequisites
- Python 3.6 or later
- AWS credentials configured for both source and destination accounts
- Appropriate S3 permissions in both accounts
AWS Credentials Setup
- Configure your AWS credentials for both accounts in
~/.aws/credentials:
[source-profile]
aws_access_key_id = YOUR_SOURCE_ACCESS_KEY
aws_secret_access_key = YOUR_SOURCE_SECRET_KEY
[dest-profile]
aws_access_key_id = YOUR_DEST_ACCESS_KEY
aws_secret_access_key = YOUR_DEST_SECRET_KEY
- Ensure you have the necessary S3 permissions:
- Source bucket:
s3:ListBucket,s3:GetObject - Destination bucket:
s3:ListBucket,s3:PutObject
- Source bucket:
Usage
Basic usage:
s3hop source-profile s3://source-bucket/prefix/ dest-profile s3://dest-bucket/prefix/
Example with specific profiles and paths:
s3hop prod s3://prod-bucket/data/ staging s3://staging-bucket/backup/
Arguments
source-profile: AWS profile for the source accountsource_url: Source S3 URL (s3://bucket-name/prefix/)dest-profile: AWS profile for the destination accountdest_url: Destination S3 URL (s3://bucket-name/prefix/)
Features in Detail
-
Smart File Comparison
- Compares files using ETags and last modified timestamps
- Only copies new or updated files
- Preserves existing files that haven't changed
-
Progress Tracking
- Real-time transfer speed
- Estimated time remaining
- Progress bar with file counts
- Total data transferred/remaining
-
Transfer Summary
- Start and end times
- Duration
- Number of files transferred/skipped
- File type statistics
- Failed transfers (if any)
Development
For development setup and contributing guidelines, see CONTRIBUTING.md.
Changelog
See CHANGELOG.md for a list of changes and version history.
Security
For security issues, please email security@hamsti.co instead of using the issue tracker.
Support
- 📫 Email: john@hamsti.co
- 🐛 Issues: GitHub Issues
License
MIT License - see LICENSE for details.
Acknowledgments
Metadata
Release files for s3hop 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| s3hop-0.1.5.tar.gz | 9.2 kB | With provenance | Details for s3hop-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| s3hop-0.1.5-py3-none-any.whl | Python 3 | none | any | Details for s3hop-0.1.5-py3-none-any.whl |
Total release size: 18.2 kB
Release files / s3hop-0.1.5.tar.gz
| Download URL | s3hop-0.1.5.tar.gz |
|---|---|
| Size | 9.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
458ab37095f78e180c32e5d5afec2d034286328fef54780cc24b709c98c85cb7
|
|
BLAKE2b-256 checksum How to use checksums |
277a38e16ec242d9576def0f856a6734f31dfbe389d390c4b653aaa5ed96de81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 28, 2025.
Transparency logRelease files / s3hop-0.1.5-py3-none-any.whl
| Download URL | s3hop-0.1.5-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7a42b7e51f2836c12c614561b747a32bfa677d4c6ac32d69e2ac4b4bb6ba7299
|
|
BLAKE2b-256 checksum How to use checksums |
e8f7cd4d57ad4ba4608cbde069e1ab7a61031be0241603c9d1548aa249dbc19f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 28, 2025.
Transparency logSecurity for s3hop 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for s3hop-0.1.5.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 28, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.