Skip to main content

Unload utility for Amazon Redshift

Project description

redshift-unloader

Unloads the result of a query on Amazon Redshift to local storage.

Prerequisites

  • Python 3.6+
  • boto3 1.7.84
  • psycopg2 2.7.5
  • psycopg2-binary 2.7.5

Installation

The package is available on PyPI:

pip install redshift-unloader

Usage

Unloaded data is supposed to be gzipped.

from redshift_unloader import RedshiftUnloader

ru = RedshiftUnloader(host='<redshift host>',
                      port=<redshift port>,
                      user='<redshift user>',
                      password='<redshift password>',
                      database='<redshift database name>',
                      s3_bucket='<s3 bucket name>',
                      access_key_id='<aws access key id>',
                      secret_access_key='<aws secret access key>',
                      region='<aws region>',
                      verbose=False)

ru.unload("SELECT * FROM my_table WHERE log_time >= 'yyyyMMdd'",
          "/path/to/result.csv.gz",
          delimiter=',',
          add_quotes=True,
          escape=True,
          null_string='',
          with_header=True)

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

redshift-unloader-0.1.4.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

redshift_unloader-0.1.4-py36-none-any.whl (6.2 kB view details)

Uploaded Python 3.6

File details

Details for the file redshift-unloader-0.1.4.tar.gz.

File metadata

  • Download URL: redshift-unloader-0.1.4.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for redshift-unloader-0.1.4.tar.gz
Algorithm Hash digest
SHA256 c3fd65dc68cd219111f942620e38000ca0d3deda848a45038227fbcd198959b2
MD5 dfb6fe8b50454102b50a4175d7dd6366
BLAKE2b-256 0982c0a4c84ee30416c9fd905f1a6e83b42f24adc6890fec55a60ffe40190649

See more details on using hashes here.

File details

Details for the file redshift_unloader-0.1.4-py36-none-any.whl.

File metadata

  • Download URL: redshift_unloader-0.1.4-py36-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3.6
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for redshift_unloader-0.1.4-py36-none-any.whl
Algorithm Hash digest
SHA256 ac5e3ec240c8502f2dd709348344434ee43ee1c6476b19c42b6007045118b3aa
MD5 bbc63f554f62111318a78993592db918
BLAKE2b-256 222886b90668143127857e0c4b9e6b75373159f0fef382ecd5545cff88145731

See more details on using hashes here.

Supported by

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