Google Sheets Input
Wiener can use Google Sheets spreadsheets as table input instead of Excel files.
Google Sheets input is available in both the Standalone version (Wiener.exe, etc.) and the Unity Asset version.
Overall Flow
Google Cloud
Create service account → Issue JSON key
↓
Share the spreadsheet with the service account email (Viewer permission)
↓
Add google_sheets settings to the settings file
↓
Specify the spreadsheet URL in the YAML input_path
↓
Run convert (data is fetched automatically by xlsx export)
Setup Steps
1. Google Cloud Setup
Complete the following steps in Google Cloud.
If you use the Unity Asset version, see Google Sheets Settings after completing the Google Cloud setup.
Create a Service Account
Create a service account for Wiener. No roles are required — access to spreadsheets is controlled via sharing settings described below.
Create an Authentication JSON Key
Create a JSON type key for the service account and download it. This file is used as the credential.
Important
Create an authentication JSON key for each user and save it in the designated location.
The authentication JSON key is a secret. Be sure to add it to .gitignore so that it is not committed to the repository.
Share the Spreadsheet
Share the target spreadsheet with the service account email address (xxx@xxx.iam.gserviceaccount.com) as a Viewer.
2. Add google_sheets to the Settings File
google_sheets:
credential_path: "../secrets/wiener-service-account.json"
See the google_sheets section of the settings file for details on each field.
3. Specify the Spreadsheet URL in the YAML input_path
Set the spreadsheet URL directly as the path value.
header:
input_path:
- path: https://docs.google.com/spreadsheets/d/xxxxxxxx/edit#gid=0
sheet: SystemText
row: 5
The gid (sheet ID) in the URL is ignored. The sheet name specified in the sheet field is used instead.
You can mix local Excel files and Google Sheets in the same YAML.
header:
input_path:
- path: item/item.xlsm
- path: https://docs.google.com/spreadsheets/d/xxxxxxxx/edit#gid=0
sheet: Item
row: 5
Export Size Limit and Splitting Files
Google Sheets input downloads each spreadsheet as xlsx through the Google Drive API export feature, then reads the downloaded xlsx locally. Drive API export results have a 10 MB limit, so fetching fails if a single spreadsheet becomes too large.
For large tables, split the data into multiple spreadsheets by use case or ID range. If the split spreadsheets use the same sheet name, you can load them from one YAML by listing multiple URLs in input_path.
For example, split the Item sheet into two spreadsheets.
| ItemMaster_A | ItemMaster_B | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
Keep the spreadsheet names and URLs.
| Spreadsheet | URL |
|---|---|
| ItemMaster_A | https://docs.google.com/spreadsheets/d/aaaaaaaa/edit#gid=0 |
| ItemMaster_B | https://docs.google.com/spreadsheets/d/bbbbbbbb/edit#gid=0 |
In YAML, specify both URLs for the same sheet: Item.
header:
input_path:
- path: https://docs.google.com/spreadsheets/d/aaaaaaaa/edit#gid=0
- path: https://docs.google.com/spreadsheets/d/bbbbbbbb/edit#gid=0
sheet: Item
row: 5
source_type: Normal
container_type: List
name: Item
output_path: item
With this setup, Wiener reads the Item sheet from both ItemMaster_A and ItemMaster_B and treats them as one YAML definition.
CSV Output
When CSV is included in output_format, normal data loaded from Google Sheets is written to the following path.
csv/GoogleSheets/{header.output_path}/{header.name}_{sheet}_{spreadsheetId}.csv
source_type: Enum EnumBase data is handled separately. Even when loaded from Google Sheets, it is written to csv/EnumBase and is not written under csv/GoogleSheets.
Team Development Workflow
When working in a team, issue a separate JSON key for each developer using a shared service account, and have each developer specify their own key via credential_path in their local environment.
Do not share JSON keys via Git. Use a password manager or your CI/CD's Secrets feature to distribute them securely.
For CI/CD, the recommended approach is to write the JSON key from a Secret to a temporary file, then set credential_path to that file path.
Notes
- Google Sheets input is available in both the Standalone version (
Wiener.exe, etc.) and the Unity Asset version - Wildcards are not supported for Google Sheets input (local Excel input only)
- The
gidin the URL is ignored. Always specify the sheet name using thesheetfield - Google Sheets input downloads each spreadsheet as an xlsx export and reads it locally
- xlsx export has a 10 MB limit. Split large tables into multiple spreadsheets
Related
- Settings File —
google_sheetssettings details - YAML Header Definition —
input_pathspecification - Localization — combining with multi-language support
- Unity Asset Google Sheets Settings — placing and registering the credential JSON key in the Unity Asset version