Connector to upload csv/csv gzip files from S3 bucket into Redshift table.


Keywords
aws, s3, redshift, csv, gzip
License
MIT
Install
pip install S3ToRedshift==0.1.16

Documentation

S3ToRedshift

Connector to upload csv/csv gzip file from S3 bucket into Redshift table.

Install with pip

$ pip install S3ToRedshift

Usage

  1. Import the library.

    from S3ToRedshift import S3ToRedshift
  2. Create an instance by defining aws access credentials, redshift credentials and region name. These parameters might not be needed, depending on the machine"s access rights.

    s3_to_redshift = S3ToRedshift(
        aws_access_key_id="##########",
        aws_secret_access_key="##########",
        aws_region_name="##########",
        host="##########",
        user="##########",
        password="##########",
        dbname="##########",
        port="##########",
        iam_role="##########"
    )
  3. The imported module has several functions. Please refer to respective help for more information.

    1. s3_to_redshift.upload_csv(schema_name, table_name, bucket_name, object_name, file_type, if_exists, csv_sep, csv_null_identifier)

© 2020, Samyak Ratna Tamrakar.