Google Sheets to Google Cloud Storage Transfer Operators¶
Google has a service Google Cloud Storage. This service is used to store large data from various applications.
With Google Sheets, everyone can work together in the same spreadsheet at the same time. Use formulas functions, and formatting options to save time and simplify common spreadsheet tasks.
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.
Upload data from Google Sheets to GCS¶
To upload data from Google Spreadsheet to Google Cloud Storage you can use the
GoogleSheetsToGCSOperator
.
upload_sheet_to_gcs = GoogleSheetsToGCSOperator(
task_id="upload_sheet_to_gcs",
destination_bucket=BUCKET_NAME,
spreadsheet_id=SPREADSHEET_ID,
)
You can use Jinja templating with
spreadsheet_id
, destination_bucket
, destination_path
, sheet_filter
, impersonation_chain
.