Upload data from Local Filesystem to Google Drive

The Google Drive is used to store large data from various applications. This page shows how to upload data from local filesystem to Google Drive.

Prerequisite Tasks

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

LocalFilesystemToGoogleDriveOperator

LocalFilesystemToGoogleDriveOperator allows you to upload data from local filesystem to GoogleDrive.

When you use this operator, you can upload a list of files.

Below is an example of using this operator to upload data from local filesystem to Google Drive.

tests/system/providers/google/suite/example_local_to_drive.py[source]

    upload_single_file = LocalFilesystemToGoogleDriveOperator(
        gcp_conn_id=CONNECTION_ID,
        task_id="upload_single_file",
        local_paths=SINGLE_FILE_LOCAL_PATHS,
        drive_folder=DRIVE_FOLDER,
    )

Was this entry helpful?