1.3 KiB
1.3 KiB
Google Drive API 設定指南
📋 功能說明
系統自動化流程(PChome 後台業績匯出):
- PChome 後台業績 Excel 先被放入 Google Drive
當日業績匯入資料夾。 momo-scheduler每 30 分鐘檢查待匯入檔案。- 自動下載
即時業績_當日.xlsx或符合設定 pattern 的 Excel。 - 自動辨識明細 worksheet / 表頭列,匯入至
daily_sales_snapshot並同步realtime_sales_monthly。 - 成功檔案歸檔至
已匯入;格式或日期不合格的檔案移至匯入失敗,避免重複告警。
🔑 認證資訊庫
| 項目 | 值 |
|---|---|
| Google Cloud 專案名 | wooo-481204 |
| Client ID | 132823079326-h9cvj5eahigm8hp9q0b7t5rk77bhu3gp... |
| 認證帳號 | owen.tsai@gmail.com |
🛠️ 首次認證步驟
若 config/google_token.pickle 遺失或過期,執行以下指令:
python3 -c "from services.google_drive_service import drive_service; drive_service.authenticate()"
執行後會彈出瀏覽器要求授權。
📁 資料夾結構要求
Google Drive 根目錄必須存在:
我的雲端硬碟/業績報表/當日業績/
後續若要把 PChome 後台人工匯出改成全自動,先閱讀
docs/guides/pchome_sales_import_automation.md。