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

GCSToLocalFilesystemOperator

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

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

airflow/providers/google/cloud/example_dags/example_gcs_to_local.py[source]

    download_file = GCSToLocalFilesystemOperator(
        task_id="download_file",
        object_name=PATH_TO_REMOTE_FILE,
        bucket=BUCKET,
        filename=PATH_TO_LOCAL_FILE,
    )

Reference

For further information, look at:

Was this entry helpful?