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.0.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.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: s3adapter-0.6.0.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.0.tar.gz
Algorithm Hash digest
SHA256 1025640558faa3c300d997e33eaf65426f28923513aac282f59bb412e413dea7
MD5 fa92e9d1c446b630d6e49fa71f3ceb31
BLAKE2b-256 0e8e58a7292b57b7a57b2f1e442c1677ffac429d7f83783472d8b9ed9ad98ba3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: s3adapter-0.6.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a5ec10821ed36664fd836e9f601085a0146f97af71a22ec7229a0faad2174df
MD5 9aff05f57903f0699afaa0486a4faa04
BLAKE2b-256 e73454d6f3746319513300c1789b5ad4e7f512257c6c212ef303465aa575f6fb

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