https://github.com/dacort/athena-gsheets
Athena Data Source Connector for 0day Google Sheet
https://github.com/dacort/athena-gsheets
Last synced: 3 months ago
JSON representation
Athena Data Source Connector for 0day Google Sheet
- Host: GitHub
- URL: https://github.com/dacort/athena-gsheets
- Owner: dacort
- Created: 2021-09-18T06:02:38.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-09-20T17:03:40.000Z (over 4 years ago)
- Last Synced: 2025-04-12T21:09:47.970Z (9 months ago)
- Language: Python
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Athena Google Sheets Example
An example of using the [Unofficial Athena Query Federation Python SDK](https://github.com/dacort/athena-federation-python-sdk/) to query data from a Google Sheet!
## Overview
This is a little bit of a hard-coded example, but it shows how to query Google Sheets data using Amazon Athena.
## How to use
- Go to the Google Developer Console and enable the Google Sheets API and create an API key
- Follow the instructions in the [Python SDK](https://github.com/dacort/athena-federation-python-sdk#creating-your-lambda-function) repo for building the Docker image and creating your Lambda function.
- Update `athena_gsheets.py` with your desired sheet name (`All` in my case)
- Provide your desired sheet ID and API key as environment variables to your Lambda function
```shell
aws lambda create-function \
--function-name athena-gsheets \
--role arn:aws:iam::${AWS_ACCOUNT_ID}:role/athena-example-execution-role \
--code ImageUri=${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/athena_gsheets:${IMAGE_TAG} \
--environment 'Variables={TARGET_BUCKET=,GOOGLE_SHEET_API_KEY=,GOOGLE_SHEET_ID=}' \
--description "Athena GSheet Example" \
--timeout 60 \
--package-type Image
```