
成果範例
Merging the monthly sales files of 9 shops into one Excel report
How it is run
python merge_sales.py --month 2026-10
2026-11-02 09:14:03 INFO Folder: sales/2026-10, 9 files found
2026-11-02 09:14:03 INFO shop-01.csv: 1,284 rows
2026-11-02 09:14:04 INFO shop-02.xlsx: 967 rows
2026-11-02 09:14:04 WARN shop-07.csv: 3 rows without a price skipped (lines 88, 412, 913)
2026-11-02 09:14:05 INFO Done: 10,412 rows -> report-2026-10.xlsx (sheets "Sales" and "Totals")
Settings, not code
The column names of each shop live in settings.ini, so a new shop or a renamed column is a line there:
[columns]
date = Date, Sale date, Day
product = Product, Item, Name
quantity = Qty, Quantity, Pcs
price = Price, Unit price
A part of the code
def read_shop_file(path: Path, columns: dict[str, list[str]]) -> pd.DataFrame:
"""Reads one shop's file and gives it the report's column names."""
table = pd.read_excel(path) if path.suffix == ".xlsx" else pd.read_csv(path, encoding="utf-8-sig")
renamed = {}
for name, variants in columns.items():
found = next((c for c in table.columns if c.strip() in variants), None)
if found is None:
raise ReportError(f"{path.name}: no column for '{name}' (looked for {', '.join(variants)})")
renamed[found] = name
table = table.rename(columns=renamed)[list(columns)]
table["shop"] = path.stem
return table
Files: a ZIP archive with merge_sales.py (310 lines), settings.ini, requirements.txt and a README with installing Python, running the script and what each message in the log means. The client runs it on their own computer.
Client: a small chain of 9 stationery shops; each shop sends its sales for the month as a CSV or Excel file, with slightly different column names. Task: one script that reads every file in a folder, brings the columns to one shape, and writes a single Excel report with all sales and a sheet of totals by shop.
客戶與所有細節皆為虛構。
關於此服務
Google Merchant Center 可以直接從 Google 試算表讀取商品,但只接受它自己的欄位:id、title、description、link、image_link、availability、附貨幣代碼的 price、brand、gtin 等等。這個 Google Apps Script 會讀取您依自己工作習慣安排的商品試算表,另外建立一個符合該格式的 Feed 分頁:價格寫成 19.99 USD、把「有庫存」或 0 轉成 Merchant Center 接受的用語、把標題縮短到長度限制內;標準版起,還會在您送出前列出缺少連結、圖片或價格的資料列。Feed 分頁由您自己在 Merchant Center 中連結。資料來自您的試算表,必須與您的網站一致;Google 會審查每項商品,所以沒有人能保證一定通過審核。
包含內容
- 您會得到一個 ZIP 壓縮檔,內含 Apps Script 程式碼和 README,說明如何加到您的試算表,並在 Merchant Center 中連結 Feed 分頁;訂單頁面上也會顯示程式碼。
- Merchant Center 欄位id、title、link、image_link、price、availability 等等
- 您的試算表維持原樣資料提供建立在另一個分頁上
- 它接受的值附貨幣的價格、使用其用語的庫存狀態
- 上傳前發現問題標準版起,列出缺少必填欄位的資料列
- 易讀的程式碼附有註解,日後很容易新增欄位
服務流程
- 1試算表您提供商品試算表的欄位,以及商店所在國家和幣別
- 2程式碼我們撰寫腳本和安裝說明
- 3試跑您建立資料提供,並在 Merchant Center 中連結
- 4修改您在方案範圍內提出修改,並附上任何錯誤訊息
需要您提供的資料
您商品試算表的欄位名稱和 10–20 列資料(從真實目錄複製或虛構皆可)、您銷售的國家和幣別、庫存的呈現方式(數字、有庫存、是或否),以及不同尺寸或顏色的商品是否分成不同列。如果有的話,請提供品牌和條碼(GTIN);如果 Merchant Center 要求在資料提供中填寫運送和稅務資訊,也請一併提供;以及這份試算表是否位於您可以編輯的 Google 帳戶中。
我們會詢問您:
- 您的商品試算表長什麼樣子?
- 您在哪裡銷售?
- 商品有多種款式嗎?
比較方案
付款保障
下單時付款,但只有在驗收成果後,款項才會撥付。
- 固定價格付款後,方案價格不會變動。
- 款項先行保留付款時,金額只會先保留,在您驗收後才會撥付給服務。
- 交付前檢查每份成果在交到您手上之前都會經過品質檢查,您也可以在驗收前於訂單頁面查看成果。
- 免費修改在需求說明範圍內,可依方案允許的次數提出修改。
- 3 天後自動驗收若您在交付後 3 天內未驗收也未提出修改,成果將自動驗收。若您在交付後於訂單聊天室留言,訂單會暫停自動驗收;我們回覆後,可能會重新起算 3 天,並會在聊天室中告知。
- 重新製作或全額退款若成果不符合您的需求說明且修改後仍未改善,或製作時間超過交付期限的兩倍,請在訂單聊天室留言:我們將重新製作,或全額退還款項。
常見問題
我的商品會通過審核嗎?
我們無法保證:Google 會依自己的規則審查每項商品,包括您的網站和政策。腳本會讓資料提供符合 Merchant Center 的格式,並顯示缺少的欄位;資料內容由您負責。
Merchant Center 會自己更新資料提供嗎?
Merchant Center 可以依自己的排程讀取 Google 試算表資料提供。腳本會在您按下按鈕時重建 Feed 分頁,或依進階版的說明,用時間觸發條件在那之前先重建。
可以從我的 Shopify 或 WooCommerce 商店取得商品嗎?
這項服務是從 Google 試算表建立資料提供。如果您的商品在商店裡,請先匯出到試算表;透過商店的 API 載入則是另一項工作。
你們會取得 Merchant Center 的存取權嗎?
不會。腳本由您加到自己的試算表,資料提供也由您在自己的 Merchant Center 帳戶中連結。我們絕不登入。
沒有找到您要的答案?