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.5.tar.gz (3.5 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.5-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for s3adapter-0.5.tar.gz
Algorithm Hash digest
SHA256 8fd095965329d9a52a9db24558f30e7f21d2984ba724adaba2ec4d60ce220d7d
MD5 5f4a9aad6ba2275eecf618f939a73c41
BLAKE2b-256 b9d735b52f0258c0e28d395e7303c51158ffd02cfa51f0fc5fca29c78e1bd1b2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: s3adapter-0.5-py3-none-any.whl
  • Upload date:
  • Size: 5.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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8d178dcf6b9858c2a5ca5fc6165e3e35b32953b0648f6ae3c13e6a581eda6506
MD5 355486fab7541933d676c219995cb782
BLAKE2b-256 a3d53d124e41485db7c9179a6fa451accc09363814d290e8c94042d11485efa8

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