A tool to copy files between S3 buckets across AWS accounts
Project description
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file s3hop-0.1.2.tar.gz.
File metadata
- Download URL: s3hop-0.1.2.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d27eecd20163d41e7695e078a81054a75baab016245c7a9a41d703f6835e8610
|
|
| MD5 |
1a220186a53bc97d3c027c01723617fb
|
|
| BLAKE2b-256 |
b98c11895ec3fc4b49d893a67eaf38c3c89f9a00cbe04d3627821708047e66a0
|
Provenance
The following attestation bundles were made for s3hop-0.1.2.tar.gz:
Publisher:
publish.yml on thehamsti/s3hop
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
s3hop-0.1.2.tar.gz -
Subject digest:
d27eecd20163d41e7695e078a81054a75baab016245c7a9a41d703f6835e8610 - Sigstore transparency entry: 160192677
- Sigstore integration time:
-
Permalink:
thehamsti/s3hop@25a1a1c988d7515c80b61852c46253cea326a024 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/thehamsti
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@25a1a1c988d7515c80b61852c46253cea326a024 -
Trigger Event:
push
-
Statement type:
File details
Details for the file s3hop-0.1.2-py3-none-any.whl.
File metadata
- Download URL: s3hop-0.1.2-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34eed23cc0fcb0287d2519342bf46c28e25292c1ba5dff80598144e301b25561
|
|
| MD5 |
7720c8af6c9ed12acbc25a3bc859df5e
|
|
| BLAKE2b-256 |
7c6217d3aac461456136c98968b326b2664f64cda788deb76c4c4fd1d91e4639
|
Provenance
The following attestation bundles were made for s3hop-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on thehamsti/s3hop
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
s3hop-0.1.2-py3-none-any.whl -
Subject digest:
34eed23cc0fcb0287d2519342bf46c28e25292c1ba5dff80598144e301b25561 - Sigstore transparency entry: 160192678
- Sigstore integration time:
-
Permalink:
thehamsti/s3hop@25a1a1c988d7515c80b61852c46253cea326a024 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/thehamsti
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@25a1a1c988d7515c80b61852c46253cea326a024 -
Trigger Event:
push
-
Statement type: