瑞肯材料科技有限公司 Certificate of Analysis (COA) 報告產生器。
├── app.py # 主程式(GUI 入口)
├── generator.py # 報告產生邏輯(docxtpl)
├── product_specs.json # 各產品規格資料
├── requirements.txt
├── Makefile # 建置指令
├── RaychemReport.spec # PyInstaller macOS 設定
├── templates/ # COA Word 模板
├── fonts/ # Noto Sans TC 字型
├── icons/ # 應用程式圖示(.icns / .svg)
├── scripts/
│ └── build_mac.sh # macOS 建置腳本
程式會將「上次匯出路徑」儲存在:
~/Library/Application Support/com.raychemmaterial.coa/config.json
- Python 3.13(建議使用 pyenv)
- macOS(本機開發)
python3.13 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txtpython app.pypython -m unittest discover -v| 套件 | 版本 | 用途 |
|---|---|---|
| tkinter | Python standard library | GUI 框架與原生檔案對話框 |
| docxtpl | 0.20.2 | Word 模板渲染(Jinja2 語法) |
| python-docx | 1.2.0 | Word 文件操作 |
| docxcompose | 2.2.0 | 合併 Word 文件 |
| python-dateutil | 2.9.0 | 日期計算(有效期限推算) |
| PyInstaller | 6.21.0 | 打包成 macOS .app |
| Jinja2 | 3.1.6 | 模板引擎(docxtpl 依賴) |
| lxml | 6.1.1 | XML 解析(python-docx 依賴) |
| 工具 | 用途 |
|---|---|
| PyInstaller | 打包成 macOS .app |
| create-dmg | 建立 macOS DMG 安裝檔 |
| Make | 本機建置指令管理 |
前置需求:
brew install create-dmg建置:
make build
# 或直接執行
./scripts/build_mac.sh產出:
dist/瑞肯COA.apprelease/瑞肯COA_<版本>_Installer.dmg
本專案使用語意化版本(例如 v1.0.0)。
git checkout main
git pull origin main
python -m unittest discover -v
make tag VERSION_ARG=v1.0.0這個指令會:
- 在當前 commit 建立 git tag
- 將 tag push 到 GitHub
- 之後可執行
make build在本機建立 macOS DMG
Release tag 必須指向已合併到
main的 commit;make tag會檢查本機main是否與origin/main同步。
| 版本 | 情境 |
|---|---|
v1.0.0 |
正式版 |
v1.1.0 |
新增功能 |
v1.1.1 |
Bug 修正 |
v1.2.0-beta |
預覽版(自動標為 prerelease) |
| 指令 | 說明 |
|---|---|
make 或 make build |
本機建置 macOS .app + DMG |
make clean |
清除 build/、dist/、release/ |
make tag VERSION_ARG=vX.Y.Z |
打版本 tag 並推送 |
目前無已知待辦事項。