Downloads data from Google Cloud Storage to Local Filesystem

The Google Cloud Storage (GCS) is used to store large data from various applications. This page shows how to download data from GCS to local filesystem.

Prerequisite Tasks

To use these operators, you must do a few things:

GCSToLocalFilesystemOperator

GCSToLocalFilesystemOperator allows you to download data from GCS to local filesystem.

Below is an example of using this operator to download a file from GCS.

tests/system/providers/google/cloud/gcs/example_gcs_upload_download.py[source]

    download_file = GCSToLocalFilesystemOperator(
        task_id="download_file",
        object_name=FILE_NAME,
        bucket=BUCKET_NAME,
        filename=PATH_TO_SAVED_FILE,
    )

Reference

For further information, look at:

Was this entry helpful?