Skip to main content

An AWS s3 utility package

Project description

S3Manager - A Python Package for Interacting with AWS S3

This Python package, S3Manager, provides a convenient way to interact with Amazon S3 buckets and objects. It offers functionalities for creating, managing, uploading, downloading, and deleting buckets and objects.

Installation

To install the S3Manager package, you can use pip

Bash pip install pip install s3_manager_package_nci_23384069

Usage

  1. Import the S3Manager Class: from s3_manager_package_nci_23384069 import S3Manager

  2. Create an S3Manager Object: s3_manager = S3Manager()

  3. Interact with S3 Buckets and Objects: The S3Manager class provides various methods for managing S3 resources. Here are some examples:

  • Creating a Bucket: bucket_name = "my-bucket" region = "us-west-2" # Optional, defaults to us-east-1

s3_manager.create_s3_bucket(bucket_name, region)

  • Listing Existing Buckets: s3_manager.list_buckets()

  • Uploading a File: file_name = "data.txt" bucket_name = "my-bucket" object_key = "data/processed.txt" # Optional, defaults to file_name

s3_manager.upload_file(file_name, bucket_name, object_key)

  • Uploading a Base64 Encoded String: base64_string = "your_base64_encoded_data" bucket_name = "my-bucket" object_key = "data.txt" # Optional

s3_manager.upload_base64_file(base64_string, bucket_name, object_key)

  • Downloading an Object (Saving to File): bucket_name = "my-bucket" object_key = "data.txt" destination_file_name = "downloaded_data.txt"

s3_manager.download_s3_object(bucket_name, object_key, destination_file_name) Downloading an Object (Returning Base64 String): bucket_name = "my-bucket" object_key = "data.txt"

base64_data = s3_manager.download_s3_object_to_base64(bucket_name, object_key)

if base64_data: print(f"Downloaded base64 data: {base64_data}") else: print("Error downloading object")

  • Deleting a Bucket: bucket_name = "my-bucket" region = "us-west-2" # Optional, region where the bucket resides

s3_manager.delete_bucket(region, bucket_name)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file s3_manager_package_nci_23384069-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for s3_manager_package_nci_23384069-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 805b09358de011a278a451a21cb54806598a12f03add00a4d17eb11d3c13620b
MD5 bdf4be4314edfbc6c5928a2016fa6509
BLAKE2b-256 1ede63bd9ee16da6181f3f612c226e5cdaa47520b8803353b66461d07b61d441

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page