開發
成果範例
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.
客戶與所有細節皆為虛構。
關於此服務
當您需要寫同一封郵件給 80 位客戶、學生或合作夥伴,裡面還要放各自的姓名、日期或金額時,複製貼上要花好幾個小時。這個 Google Apps Script 放在您的 Google 試算表中,從您自己的 Gmail 為每一列寄出個人化郵件:它會把 {{Name}}、{{Date}} 和其他任何欄位填入您的範本,在該列寫上「已寄出」和時間,並跳過已寄出的列,所以重複執行也很安全。它是為了寄給您自己名單上、期待收到您郵件的人而設計的,不適用於購買的名單或陌生大量寄信。Google 會限制指令碼每天可寄出的郵件數量,免費 Gmail 的額度比 Google Workspace 低;腳本到達上限就會停止,之後再繼續。腳本由您在自己的帳戶中安裝和執行。
包含內容
- 您會得到一個 ZIP 壓縮檔,內含 Apps Script 程式碼和 README,說明如何貼到您的試算表、授權存取並寄送;訂單頁面上也會顯示程式碼。
- 個人化欄位試算表的任何欄位都能放進主旨和內文
- 從您自己的 Gmail 寄出回覆會寄回給您,就像您寄出的任何郵件
- 寄出標記每一列都會顯示寄出時間,所以不會重複寄送
- 符合 Google 的限制到達每日上限就停止,之後再繼續
- 易讀的程式碼附有註解,日後很容易修改範本
服務流程
- 1任務您提供試算表的欄位和想寄出的郵件
- 2程式碼我們撰寫腳本和安裝說明
- 3試跑您貼到試算表的副本中,先寄給自己的信箱測試
- 4修改您在方案範圍內提出修改,並附上任何錯誤訊息
需要您提供的資料
您試算表的欄位名稱和兩三列虛構姓名與地址的資料、郵件的主旨和內文(標出各欄位要放的位置),以及是純文字還是使用 Gmail 草稿中的格式。名單上的人是誰、他們是怎麼加入名單的(您的客戶、會員、學生)、大約有多少列,以及您使用免費 Gmail 還是 Google Workspace。如果有附件,請說明附件在您雲端硬碟的哪裡。
我們會詢問您:
- 您要寫信給誰?
- 試算表有哪些欄位?
- 郵件要寫什麼?
- 免費 Gmail 還是 Google Workspace?
比較方案
付款保障
下單時付款,但只有在驗收成果後,款項才會撥付。
- 固定價格付款後,方案價格不會變動。
- 款項先行保留付款時,金額只會先保留,在您驗收後才會撥付給服務。
- 交付前檢查每份成果在交到您手上之前都會經過品質檢查,您也可以在驗收前於訂單頁面查看成果。
- 免費修改在需求說明範圍內,可依方案允許的次數提出修改。
- 3 天後自動驗收若您在交付後 3 天內未驗收也未提出修改,成果將自動驗收。若您在交付後於訂單聊天室留言,訂單會暫停自動驗收;我們回覆後,可能會重新起算 3 天,並會在聊天室中告知。
- 重新製作或全額退款若成果不符合您的需求說明且修改後仍未改善,或製作時間超過交付期限的兩倍,請在訂單聊天室留言:我們將重新製作,或全額退還款項。
常見問題
一天可以寄多少封郵件?
Google 允許您的帳戶透過指令碼寄出多少就能寄多少,免費 Gmail 的額度比 Google Workspace 低;Google 會在 Apps Script 配額頁面上公布目前的數字。腳本到達上限就會停止,下次執行時從第一個未寄出的列繼續。
我可以寄給購買來的名單嗎?
不行。這個腳本是用來寄給認識您、期待收到您郵件的人,例如您的客戶或會員。購買的名單和陌生大量寄信違反 Google 的規定,可能導致您的帳戶被封鎖。
會加入取消訂閱連結嗎?
它可以加上一句話,請不想收到這類郵件的人回覆告知,並跳過您標記為已取消訂閱的列。如果是需要一鍵取消訂閱的電子報,使用電子報服務會更合適。
你們會取得我 Gmail 的存取權嗎?
不會。程式碼由您貼到自己的試算表中,Google 會請您(而不是我們)授權它寄送郵件。我們絕不登入您的帳戶。
沒有找到您要的答案?


