Skip to main content

A AWS S3 Python Adapter to Readn, Write and Check existence of files in S3 Buckets.

Project description

S3Adapter

A AWS S3 Python Adapter to Readn, Write and Check existence of files in S3 Buckets. Current version use adapter to read/write a dataframe as csv in bucket

Installation

You can install My Package using pip:

pip install s3adapter

Usage

  1. Set defatut AWS Account Environment vars (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_DEFAULT_REGION) or call s3adapter.init_cloud() method

  2. Write your code like it to write an Dataframe to your bucket

from fileadapters.s3adapter import s3adapter
import pandas as pd

bucket_name = <your-bucket>
# Creating a DataFrame from a dictionary
data = {
    'Name': ['Alice', 'Bob', 'Charlie'],
    'Age': [25, 30, 22],
    'City': ['New York', 'San Francisco', 'Los Angeles']
}

df = pd.DataFrame(data)

# Initialize Adapter with Bucket Name and option to validate if cloud credentials is configured
s3 = s3adapter(bucket_name, validade_aws=True)

# Write dataframe as CSV
s3.write_dataframe_as_csv(df,file_path)

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

s3adapter-0.6.2.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

s3adapter-0.6.2-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file s3adapter-0.6.2.tar.gz.

File metadata

  • Download URL: s3adapter-0.6.2.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.0

File hashes

Hashes for s3adapter-0.6.2.tar.gz
Algorithm Hash digest
SHA256 b21fdd66e318bff8abc24014fb03026aa8a28a32eddeadba700c50ce7e90beaf
MD5 f85b3b8687fc1482d792dfc7d91a36b9
BLAKE2b-256 30ee8cdc6f0df2d15e1a266930820d2243f7d189243e171227486098ece61ddb

See more details on using hashes here.

File details

Details for the file s3adapter-0.6.2-py3-none-any.whl.

File metadata

  • Download URL: s3adapter-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.0

File hashes

Hashes for s3adapter-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2e87d579ae1e6d8c501367e10bc5e124e22c8cf09bc61226e21eb4b9dedbacb7
MD5 59135c2a52e1f6290739f625e1ffa1b4
BLAKE2b-256 a37c4ec20123bb3bc615ba8beaf5c0429639162d0a6de524ad3893f6cd8a9000

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