mcejp / sheetkeeper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sheetkeeper -- automated Google Sheets maintenance

Creating a Google Cloud Service Account

  1. Go to https://console.cloud.google.com/projectcreate and create a project
  2. Go to https://console.cloud.google.com/apis/api/sheets.googleapis.com and enable Google Sheets API for the newly created project
  3. On the top you should see the message To use this API, you may need credentials. Click 'CREATE CREDENTIALS' to get started. Click the blue button to the right.
  4. Select Application data, No, and click Next.

screenshot

  1. Choose an arbitrary Service account ID (sheetkeeper will do), click Next
  2. Click Continue and Done
  3. Go to the Credentials panel (on the left) and select the newly created Service Account
  4. Go to the Keys tab (on top) and click Add key -> Create new key
  5. Confirm the JSON type and create the key. Download the file that will pop up.
  6. Base64-encode the file with the following command: base64 -w0 <filename>.json. This will be the contents as your SHEETKEEPER_CREDENTIALS variable.

Configuration

Environment variables:

  • SHEETKEEPER_CREDENTIALS base64-encoded Service Account credentials (see instructions above)
  • SHEETKEEPER_SHEETS (format: id1:sheet1:sheet2:sheet3::id2:sheet1; IDs are spreadsheet IDs, sheets are the tab names)

S3 options (used for backup of sheet contents):

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
  • AWS_DEFAULT_REGION
  • SHEETKEEPER_BUCKET
  • SHEETKEEPER_S3_ENDPOINT

Dependencies

  • beautifulsoup4
  • boto3
  • google-api-python-client
  • google-auth-httplib2
  • requests
  • yt-dlp

About

License:MIT License


Languages

Language:Python 96.9%Language:Makefile 3.1%