Downloads data from Google Drive Storage to Local Filesystem¶
The Google Drive is used to store daily use data, including documents and photos. Google Drive has built-in mechanisms to facilitate group work e.g. document editor, file sharing mechanisms.
Prerequisite Tasks¶
To use these operators, you must do a few things:
Select or create a Cloud Platform project using the Cloud Console.
Enable billing for your project, as described in the Google Cloud documentation.
Enable the API, as described in the Cloud Console documentation.
Install API libraries via pip.
pip install 'apache-airflow[google]'Detailed information is available for Installation.
GCSToLocalFilesystemOperator¶
GoogleDriveToLocalOperator
allows you to download
data from Google Drive to local filesystem.
Below is an example of using this operator to download file from Google Drive to Local Filesystem.
download_from_gdrive_to_local = GoogleDriveToLocalOperator(
task_id="download_from_gdrive_to_local",
folder_id="",
file_name=FILE_NAME,
output_file=OUTPUT_FILE,
)