Thanks to visit codestin.com
Credit goes to github.com

Skip to content

A professional command-line interface (CLI) tool built with Python and boto3 to interact with Amazon S3.

Notifications You must be signed in to change notification settings

ayushsgit/S3-Manager-CLI-in-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

S3 Manager CLI

A Python CLI tool built with boto3 and click to demonstrate core AWS S3 operations.

Features

  • Create S3 buckets
  • Upload files
  • Download files
  • List objects in a bucket
  • Generate pre-signed URLs for temporary access

Project Structure

s3-manager-project/
├── s3_manager/
│   ├── __init__.py
│   └── cli.py
├── tests/
│   ├── __init__.py
│   └── test_cli.py
├── requirements.txt
├── setup.py
├── policy.json
└── README.md

Setup

  1. Install Python 3.8+
  2. Install the tool:
    pip install -e .
  3. Configure AWS Credentials: Ensure you have AWS credentials set up via one of these methods:
    • aws configure (sets up the default profile)
    • aws configure --profile my-profile
    • Environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)

Usage

# 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

About

A professional command-line interface (CLI) tool built with Python and boto3 to interact with Amazon S3.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages