Skip to main content

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)

Release files for redshift-unloader 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for redshift-unloader 0.1.4
File Size Uploaded
redshift-unloader-0.1.4.tar.gz 5.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for redshift-unloader 0.1.4
File Interpreter ABI Platform
redshift_unloader-0.1.4-py36-none-any.whl Python 3.6 none any Details

Total release size: 11.6 kB

Release files / redshift-unloader-0.1.4.tar.gz

Download URL redshift-unloader-0.1.4.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c3fd65dc68cd219111f942620e38000ca0d3deda848a45038227fbcd198959b2
BLAKE2b-256 checksum
How to use checksums
0982c0a4c84ee30416c9fd905f1a6e83b42f24adc6890fec55a60ffe40190649
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / redshift_unloader-0.1.4-py36-none-any.whl

Download URL redshift_unloader-0.1.4-py36-none-any.whl
Size 6.2 kB
Tags Python 3.6
SHA-256 checksum
How to use checksums
ac5e3ec240c8502f2dd709348344434ee43ee1c6476b19c42b6007045118b3aa
BLAKE2b-256 checksum
How to use checksums
222886b90668143127857e0c4b9e6b75373159f0fef382ecd5545cff88145731
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page