
成果範例
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.
客戶與所有細節皆為虛構。
關於此服務
Shopify 可以從 CSV 檔匯入商品,但只接受它自己的格式:一個商品及其所有款式共用一個 Handle、選項名稱和值放在固定欄位、圖片必須是公開連結。這個 Python 腳本會把您現有的檔案,例如供應商價目表、舊商店的匯出檔或您自己的 Excel,轉成這種格式。它會把您的欄位對應到 Shopify 的欄位;標準版起,還會把尺寸和顏色轉成款式,整理價格和庫存,並加上標籤。它依照 Shopify 目前的商品 CSV 範本製作,您可以從後台下載該範本。圖片必須放在 Shopify 能開啟的連結上。檔案由您自己在 Shopify 中匯入;我們絕不登入您的商店。請先用幾項商品試試看:結果完整與否,取決於您的資料。
包含內容
- 您會得到一個 ZIP 壓縮檔,內含 Python 腳本、附逐步說明的 README,標準版起另附記錄欄位對應的設定檔;訂單頁面上也會顯示程式碼。
- Shopify 的格式依 Shopify 目前的商品 CSV 範本
- 款式歸組標準版起,尺寸和顏色歸在同一商品下
- 整理好的價格和庫存Shopify 接受的數字,沒有貨幣符號或空格
- 列出問題回報缺少價格、SKU 或圖片的資料列
- 易讀的程式碼附有註解,日後很容易新增欄位
服務流程
- 1檔案您提供商品檔案的範例,並說明什麼對應到哪裡
- 2程式碼我們撰寫腳本和執行說明
- 3試跑您把幾項商品匯入 Shopify 並檢查
- 4修改您在方案範圍內提出修改,並附上任何錯誤訊息
需要您提供的資料
您現有檔案的 20–30 列(供應商價目表、舊商店匯出檔或您自己的表格)、其中款式的寫法(每個尺寸一列,或所有尺寸寫在同一格)、圖片在哪裡(連結,或您會先上傳到 Shopify 的檔案),以及價格如何設定。如果有的話,請提供從您 Shopify 商店匯出的幾項商品,讓欄位完全一致。您的系統:Windows、macOS 或 Linux。
我們會詢問您:
- 您現在有什麼檔案?
- 其中款式是怎麼寫的?
- 圖片在哪裡?
- 價格要怎麼設定?
比較方案
付款保障
下單時付款,但只有在驗收成果後,款項才會撥付。
- 固定價格付款後,方案價格不會變動。
- 款項先行保留付款時,金額只會先保留,在您驗收後才會撥付給服務。
- 交付前檢查每份成果在交到您手上之前都會經過品質檢查,您也可以在驗收前於訂單頁面查看成果。
- 免費修改在需求說明範圍內,可依方案允許的次數提出修改。
- 3 天後自動驗收若您在交付後 3 天內未驗收也未提出修改,成果將自動驗收。若您在交付後於訂單聊天室留言,訂單會暫停自動驗收;我們回覆後,可能會重新起算 3 天,並會在聊天室中告知。
- 重新製作或全額退款若成果不符合您的需求說明且修改後仍未改善,或製作時間超過交付期限的兩倍,請在訂單聊天室留言:我們將重新製作,或全額退還款項。
常見問題
你們會幫我把商品匯入商店嗎?
不會。我們絕不登入您的商店。CSV 由您自己在 Shopify 後台匯入;README 會說明在哪裡匯入、要選哪些選項。
如果圖片是我電腦上的檔案怎麼辦?
Shopify 在 CSV 中只接受它能開啟的圖片連結。請先把檔案上傳到 Shopify 的「檔案」區,再把它們的連結清單提供給腳本,或使用供應商提供的連結。
可以更新我現有商品的價格和庫存嗎?
可以,只要 Handle 與您現有的商品一致:Shopify 在匯入時可以覆寫 Handle 相同的商品。請先用幾項商品試試看。
它會撰寫商品描述嗎?
不會。它會沿用您檔案中的描述和資訊,並可整理格式。沒有的文字會留空並回報。
沒有找到您要的答案?