•  
      reusable_code_components #495607
    Python, REST APIs, Regex

    A lightweight, core Python script that uploads files to Amazon S3 buckets using a reusable S3Uploader class and a simple CLI—no frameworks required.

    Python S3 File Uploader is a minimal yet powerful script for uploading files to Amazon S3 using only core Python and boto3. It features a modular S3Uploader class (s3_uploader.py) and a command-line interface (upload_file_cli.py) for selecting files and uploading them to any configured S3 bucket. The script supports automatic MIME type detection, handles AWS credential errors gracefully, and allows for public file uploads. This reusable component is ideal for automation, scripting, and quick file transfers without the overhead of a full framework.

    Empty
    1. Install the required dependency:
      pip install boto3

    2. Configure AWS credentials:

      aws configure
      export AWS_ACCESS_KEY_ID=your_access_key
      export AWS_SECRET_ACCESS_KEY=your_secret_key
      export AWS_REGION=your_region

    3. Run the CLI script:
      python upload_file_cli.py

    4. When prompted, enter the full file path to upload.

    Python S3 File Uploader (Core Python)

    A simple, reusable script to upload files to an Amazon S3 bucket using core Python — no frameworks required.

    Features

    • Lightweight and dependency-minimal
    • Uploads files to any AWS S3 bucket
    • Reusable S3Uploader class
    • Supports all file types
    • Handles AWS credential errors gracefully

    Setup

    1. Install dependencies

    pip install boto3
    
    aws configure
    export AWS_ACCESS_KEY_ID=your_access_key
    export AWS_SECRET_ACCESS_KEY=your_secret_key
    export AWS_REGION=your_region
    
    2025-06-02
    Active
    Sanjay Patel (sanjay_patel)
    #495607

    Follow-ups

    User avatar
    • Readme
      Something went wrong, the follow up content couldn't be loaded
      Only formatting have been changed, you should switch to markup to see the changes
    User avatar
    • Git Repository Url
      -https://openforge.gov.in/plugins/git/smartblocks/PythonS3FileUploader.git 
      +https://openforge.gov.in/plugins/git/smartblocks/PythonS3FileUploader