A Python CLI tool built with boto3 and click to demonstrate core AWS S3 operations.
- Create S3 buckets
- Upload files
- Download files
- List objects in a bucket
- Generate pre-signed URLs for temporary access
s3-manager-project/
├── s3_manager/
│ ├── __init__.py
│ └── cli.py
├── tests/
│ ├── __init__.py
│ └── test_cli.py
├── requirements.txt
├── setup.py
├── policy.json
└── README.md
- Install Python 3.8+
- Install the tool:
pip install -e . - Configure AWS Credentials:
Ensure you have AWS credentials set up via one of these methods:
aws configure(sets up thedefaultprofile)aws configure --profile my-profile- Environment variables (
AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY)
# Get help
s3-manager --help
s3-manager create-bucket --help
# Create a bucket (bucket names must be GLOBALLY unique)
s3-manager --profile my-profile --region us-east-1 create-bucket my-unique-bucket-name-123
# Upload a file
s3-manager -p my-profile upload-file my-unique-bucket-name-2 ./my-photo.jpg --object-key images/vacation.jpg
# List objects
s3-manager -p my-profile list-objects my-unique-bucket-name-2
# Generate a pre-signed URL
s3-manager -p my-profile generate-presigned-url my-unique-bucket-name-2 images/vacation.jpg --expires-in 300
# Download a file
s3-manager -p my-profile download-file my-unique-bucket-name-2 images/vacation.jpg ./downloaded-photo.jpg