Skip to content

v1.0.2

Choose a tag to compare

@twjackysu twjackysu released this 12 Apr 11:16
· 148 commits to main since this release

代碼品質改善

Bug 修正:

  • 修正 get_stock_valuation_ratios 中「股價淊值比」→「股價淨值比」錯字
  • 修正 basic_info.py 中「株東」→「股東」欄位名稱錯誤(3處),修正後可正確取得股東會相關資料

架構改善:

  • TAIFEX tools 改用 TWSEAPIClient.fetch_json(headers=...) 取代直接 requests.get(),統一 rate limiting 和 logging
  • 統一錯誤處理:將 36 處靜默 except Exception: return "" 和 30+ 處 inline f"查詢失敗" 改為 MSG_QUERY_FAILED 常數
  • 所有 113 個 tool docstring 統一使用中文,並對齊 TWSE Swagger 官方 API 名稱
  • 新增 prompts/__init__.py 使其成為正式 Python package
  • 移除未使用的 import(MSG_QUERY_FAILED_WITH_CODE 等)
  • 刪除空的 tools/mops/ package

PEP 8 / 風格修正:

  • format 參數名改為 output_format 避免遮蔽 built-in
  • Lambda 賦值改為 def 函式
  • list[str] → List[str] 統一 type hint 風格
  • 常數從函式內部移至 module level
  • [:20] hardcoded limit 改用 DEFAULT_DISPLAY_LIMIT 常數
  • Inline "目前沒有資料。" 改用 MSG_NO_DATA 常數

清理:

  • 移除過時的 API_TODO.md、TESTING.md、PLAN.md、generate_todo.py