settfex 0.26.2__tar.gz → 0.27.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (345) hide show
  1. {settfex-0.26.2 → settfex-0.27.0}/.github/workflows/ci.yml +2 -2
  2. {settfex-0.26.2 → settfex-0.27.0}/.github/workflows/dependency-drift.yml +1 -1
  3. {settfex-0.26.2 → settfex-0.27.0}/.github/workflows/live-smoke.yml +1 -1
  4. {settfex-0.26.2 → settfex-0.27.0}/.github/workflows/pre-commit.yml +1 -1
  5. {settfex-0.26.2 → settfex-0.27.0}/.github/workflows/release.yml +2 -2
  6. {settfex-0.26.2 → settfex-0.27.0}/.github/workflows/security.yml +2 -2
  7. {settfex-0.26.2 → settfex-0.27.0}/AGENTS.md +19 -13
  8. {settfex-0.26.2 → settfex-0.27.0}/CHANGELOG.md +154 -0
  9. {settfex-0.26.2 → settfex-0.27.0}/CLAUDE.md +17 -2
  10. {settfex-0.26.2 → settfex-0.27.0}/PKG-INFO +8 -5
  11. {settfex-0.26.2 → settfex-0.27.0}/README.md +7 -4
  12. {settfex-0.26.2 → settfex-0.27.0}/docs/settfex/services/tfex/trading_statistics.md +17 -0
  13. {settfex-0.26.2 → settfex-0.27.0}/docs/settfex/utils/session_caching.md +20 -7
  14. {settfex-0.26.2 → settfex-0.27.0}/pyproject.toml +1 -1
  15. {settfex-0.26.2 → settfex-0.27.0}/settfex/__init__.py +3 -1
  16. {settfex-0.26.2 → settfex-0.27.0}/settfex/exceptions.py +19 -0
  17. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/holiday.py +9 -6
  18. settfex-0.27.0/settfex/services/tfex/_series.py +34 -0
  19. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/tfex/trading_statistics.py +27 -4
  20. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/tfex/underlying_price.py +18 -3
  21. {settfex-0.26.2 → settfex-0.27.0}/settfex/utils/session_manager.py +109 -13
  22. {settfex-0.26.2 → settfex-0.27.0}/tests/golden/api_surface.json +59 -0
  23. {settfex-0.26.2 → settfex-0.27.0}/tests/services/set/test_holiday.py +3 -2
  24. settfex-0.27.0/tests/services/tfex/test_series_not_found.py +132 -0
  25. settfex-0.27.0/tests/utils/test_session_manager.py +377 -0
  26. {settfex-0.26.2 → settfex-0.27.0}/uv.lock +211 -176
  27. settfex-0.26.2/tests/utils/test_session_manager.py +0 -157
  28. {settfex-0.26.2 → settfex-0.27.0}/.editorconfig +0 -0
  29. {settfex-0.26.2 → settfex-0.27.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  30. {settfex-0.26.2 → settfex-0.27.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  31. {settfex-0.26.2 → settfex-0.27.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  32. {settfex-0.26.2 → settfex-0.27.0}/.github/dependabot.yml +0 -0
  33. {settfex-0.26.2 → settfex-0.27.0}/.github/instructions/core-architectrual-principles.instructions.md +0 -0
  34. {settfex-0.26.2 → settfex-0.27.0}/.github/instructions/documentation-standards.instructions.md +0 -0
  35. {settfex-0.26.2 → settfex-0.27.0}/.github/instructions/file-organization.instructions.md +0 -0
  36. {settfex-0.26.2 → settfex-0.27.0}/.github/instructions/git-commit.instructions.md +0 -0
  37. {settfex-0.26.2 → settfex-0.27.0}/.github/instructions/python-dependency-management.instructions.md +0 -0
  38. {settfex-0.26.2 → settfex-0.27.0}/.github/prompts/Coding.prompt.md +0 -0
  39. {settfex-0.26.2 → settfex-0.27.0}/.github/prompts/Git-Commit-Reviewer.prompt.md +0 -0
  40. {settfex-0.26.2 → settfex-0.27.0}/.github/prompts/Prompt-Engineer.prompt.md +0 -0
  41. {settfex-0.26.2 → settfex-0.27.0}/.github/prompts/Python-Architect.prompt.md +0 -0
  42. {settfex-0.26.2 → settfex-0.27.0}/.gitignore +0 -0
  43. {settfex-0.26.2 → settfex-0.27.0}/.pre-commit-config.yaml +0 -0
  44. {settfex-0.26.2 → settfex-0.27.0}/.python-version +0 -0
  45. {settfex-0.26.2 → settfex-0.27.0}/CODE_OF_CONDUCT.md +0 -0
  46. {settfex-0.26.2 → settfex-0.27.0}/COMPREHENSIVE_AUDIT.md +0 -0
  47. {settfex-0.26.2 → settfex-0.27.0}/CONTRIBUTING.md +0 -0
  48. {settfex-0.26.2 → settfex-0.27.0}/LICENSE +0 -0
  49. {settfex-0.26.2 → settfex-0.27.0}/RELEASING.md +0 -0
  50. {settfex-0.26.2 → settfex-0.27.0}/SECURITY.md +0 -0
  51. {settfex-0.26.2 → settfex-0.27.0}/docs/guide/PYTHON_LIBRARY_BEST_PRACTICES.md +0 -0
  52. {settfex-0.26.2 → settfex-0.27.0}/docs/index.md +0 -0
  53. {settfex-0.26.2 → settfex-0.27.0}/docs/settfex/services/sec/executive_trades.md +0 -0
  54. {settfex-0.26.2 → settfex-0.27.0}/docs/settfex/services/sec/financial_report.md +0 -0
  55. {settfex-0.26.2 → settfex-0.27.0}/docs/settfex/services/set/API_PROTECTION_NOTE.md +0 -0
  56. {settfex-0.26.2 → settfex-0.27.0}/docs/settfex/services/set/analyst_consensus.md +0 -0
  57. {settfex-0.26.2 → settfex-0.27.0}/docs/settfex/services/set/board_of_director.md +0 -0
  58. {settfex-0.26.2 → settfex-0.27.0}/docs/settfex/services/set/chart_quotation.md +0 -0
  59. {settfex-0.26.2 → settfex-0.27.0}/docs/settfex/services/set/corporate_action.md +0 -0
  60. {settfex-0.26.2 → settfex-0.27.0}/docs/settfex/services/set/dr_indicative_price.md +0 -0
  61. {settfex-0.26.2 → settfex-0.27.0}/docs/settfex/services/set/earnings_call.md +0 -0
  62. {settfex-0.26.2 → settfex-0.27.0}/docs/settfex/services/set/financial.md +0 -0
  63. {settfex-0.26.2 → settfex-0.27.0}/docs/settfex/services/set/highlight_data.md +0 -0
  64. {settfex-0.26.2 → settfex-0.27.0}/docs/settfex/services/set/holiday.md +0 -0
  65. {settfex-0.26.2 → settfex-0.27.0}/docs/settfex/services/set/index.md +0 -0
  66. {settfex-0.26.2 → settfex-0.27.0}/docs/settfex/services/set/info.md +0 -0
  67. {settfex-0.26.2 → settfex-0.27.0}/docs/settfex/services/set/latest_historical_trading.md +0 -0
  68. {settfex-0.26.2 → settfex-0.27.0}/docs/settfex/services/set/list.md +0 -0
  69. {settfex-0.26.2 → settfex-0.27.0}/docs/settfex/services/set/news.md +0 -0
  70. {settfex-0.26.2 → settfex-0.27.0}/docs/settfex/services/set/nvdr_holder.md +0 -0
  71. {settfex-0.26.2 → settfex-0.27.0}/docs/settfex/services/set/price_performance.md +0 -0
  72. {settfex-0.26.2 → settfex-0.27.0}/docs/settfex/services/set/profile_company.md +0 -0
  73. {settfex-0.26.2 → settfex-0.27.0}/docs/settfex/services/set/profile_dr.md +0 -0
  74. {settfex-0.26.2 → settfex-0.27.0}/docs/settfex/services/set/profile_stock.md +0 -0
  75. {settfex-0.26.2 → settfex-0.27.0}/docs/settfex/services/set/shareholder.md +0 -0
  76. {settfex-0.26.2 → settfex-0.27.0}/docs/settfex/services/set/trading_stat.md +0 -0
  77. {settfex-0.26.2 → settfex-0.27.0}/docs/settfex/services/tfex/list.md +0 -0
  78. {settfex-0.26.2 → settfex-0.27.0}/docs/settfex/services/thaibma/yield_curve.md +0 -0
  79. {settfex-0.26.2 → settfex-0.27.0}/docs/settfex/utils/data_fetcher.md +0 -0
  80. {settfex-0.26.2 → settfex-0.27.0}/docs/solution/FINDINGS.md +0 -0
  81. {settfex-0.26.2 → settfex-0.27.0}/docs/solution/Performance Boost Session Caching Implementation.md +0 -0
  82. {settfex-0.26.2 → settfex-0.27.0}/docs/solution/SESSION_CACHE_SUMMARY.md +0 -0
  83. {settfex-0.26.2 → settfex-0.27.0}/docs/solution/SOLUTION_100_PERCENT.md +0 -0
  84. {settfex-0.26.2 → settfex-0.27.0}/examples/README.md +0 -0
  85. {settfex-0.26.2 → settfex-0.27.0}/examples/sec/01_financial_report.ipynb +0 -0
  86. {settfex-0.26.2 → settfex-0.27.0}/examples/sec/02_executive_trades.ipynb +0 -0
  87. {settfex-0.26.2 → settfex-0.27.0}/examples/set/01_stock_list.ipynb +0 -0
  88. {settfex-0.26.2 → settfex-0.27.0}/examples/set/02_highlight_data.ipynb +0 -0
  89. {settfex-0.26.2 → settfex-0.27.0}/examples/set/03_stock_profile.ipynb +0 -0
  90. {settfex-0.26.2 → settfex-0.27.0}/examples/set/04_company_profile.ipynb +0 -0
  91. {settfex-0.26.2 → settfex-0.27.0}/examples/set/05_corporate_action.ipynb +0 -0
  92. {settfex-0.26.2 → settfex-0.27.0}/examples/set/06_shareholder.ipynb +0 -0
  93. {settfex-0.26.2 → settfex-0.27.0}/examples/set/07_nvdr_holder.ipynb +0 -0
  94. {settfex-0.26.2 → settfex-0.27.0}/examples/set/08_board_of_director.ipynb +0 -0
  95. {settfex-0.26.2 → settfex-0.27.0}/examples/set/09_trading_statistics.ipynb +0 -0
  96. {settfex-0.26.2 → settfex-0.27.0}/examples/set/10_price_performance.ipynb +0 -0
  97. {settfex-0.26.2 → settfex-0.27.0}/examples/set/11_financial.ipynb +0 -0
  98. {settfex-0.26.2 → settfex-0.27.0}/examples/set/12_earnings_call.ipynb +0 -0
  99. {settfex-0.26.2 → settfex-0.27.0}/examples/set/13_chart_quotation.ipynb +0 -0
  100. {settfex-0.26.2 → settfex-0.27.0}/examples/set/14_latest_historical_trading.ipynb +0 -0
  101. {settfex-0.26.2 → settfex-0.27.0}/examples/set/15_market_index.ipynb +0 -0
  102. {settfex-0.26.2 → settfex-0.27.0}/examples/set/16_news.ipynb +0 -0
  103. {settfex-0.26.2 → settfex-0.27.0}/examples/set/17_holiday.ipynb +0 -0
  104. {settfex-0.26.2 → settfex-0.27.0}/examples/set/18_dr_and_asset_type.ipynb +0 -0
  105. {settfex-0.26.2 → settfex-0.27.0}/examples/set/19_analyst_consensus.ipynb +0 -0
  106. {settfex-0.26.2 → settfex-0.27.0}/examples/set/20_stock_info.ipynb +0 -0
  107. {settfex-0.26.2 → settfex-0.27.0}/examples/set/README.md +0 -0
  108. {settfex-0.26.2 → settfex-0.27.0}/examples/set/cpall_balance_sheet.csv +0 -0
  109. {settfex-0.26.2 → settfex-0.27.0}/examples/set/market_dashboard_20251005_173221.csv +0 -0
  110. {settfex-0.26.2 → settfex-0.27.0}/examples/set/market_dashboard_20251005_210737.csv +0 -0
  111. {settfex-0.26.2 → settfex-0.27.0}/examples/set/market_dashboard_20251006_091440.csv +0 -0
  112. {settfex-0.26.2 → settfex-0.27.0}/examples/set/thailand_banking_stocks.csv +0 -0
  113. {settfex-0.26.2 → settfex-0.27.0}/examples/set/thailand_set_main_board.csv +0 -0
  114. {settfex-0.26.2 → settfex-0.27.0}/examples/set/thailand_stock_universe.csv +0 -0
  115. {settfex-0.26.2 → settfex-0.27.0}/examples/tfex/01_series_list.ipynb +0 -0
  116. {settfex-0.26.2 → settfex-0.27.0}/examples/tfex/02_trading_statistics.ipynb +0 -0
  117. {settfex-0.26.2 → settfex-0.27.0}/examples/tfex/03_underlying_price.ipynb +0 -0
  118. {settfex-0.26.2 → settfex-0.27.0}/examples/thaibma/01_government_yield_curve.ipynb +0 -0
  119. {settfex-0.26.2 → settfex-0.27.0}/settfex/deprecations.py +0 -0
  120. {settfex-0.26.2 → settfex-0.27.0}/settfex/py.typed +0 -0
  121. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/__init__.py +0 -0
  122. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/sec/__init__.py +0 -0
  123. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/sec/company.py +0 -0
  124. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/sec/constants.py +0 -0
  125. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/sec/download.py +0 -0
  126. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/sec/executive_trades.py +0 -0
  127. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/sec/financial_report.py +0 -0
  128. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/sec/sec.py +0 -0
  129. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/sec/utils.py +0 -0
  130. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/__init__.py +0 -0
  131. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/asset_type.py +0 -0
  132. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/constants.py +0 -0
  133. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/earnings_call.py +0 -0
  134. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/index/__init__.py +0 -0
  135. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/index/chart_quotation.py +0 -0
  136. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/index/composition.py +0 -0
  137. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/index/index.py +0 -0
  138. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/index/info.py +0 -0
  139. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/index/list.py +0 -0
  140. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/index/utils.py +0 -0
  141. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/list.py +0 -0
  142. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/news.py +0 -0
  143. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/stock/__init__.py +0 -0
  144. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/stock/analyst_consensus.py +0 -0
  145. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/stock/board_of_director.py +0 -0
  146. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/stock/chart_quotation.py +0 -0
  147. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/stock/corporate_action.py +0 -0
  148. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/stock/dr_indicative_price.py +0 -0
  149. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/stock/financial/__init__.py +0 -0
  150. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/stock/financial/financial.py +0 -0
  151. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/stock/highlight_data.py +0 -0
  152. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/stock/info.py +0 -0
  153. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/stock/latest_historical_trading.py +0 -0
  154. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/stock/nvdr_holder.py +0 -0
  155. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/stock/price_performance.py +0 -0
  156. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/stock/profile_company.py +0 -0
  157. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/stock/profile_dr.py +0 -0
  158. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/stock/profile_stock.py +0 -0
  159. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/stock/shareholder.py +0 -0
  160. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/stock/stock.py +0 -0
  161. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/stock/trading_stat.py +0 -0
  162. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/set/stock/utils.py +0 -0
  163. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/tfex/__init__.py +0 -0
  164. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/tfex/constants.py +0 -0
  165. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/tfex/list.py +0 -0
  166. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/thaibma/__init__.py +0 -0
  167. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/thaibma/availability.py +0 -0
  168. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/thaibma/constants.py +0 -0
  169. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/thaibma/history.py +0 -0
  170. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/thaibma/thaibma.py +0 -0
  171. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/thaibma/utils.py +0 -0
  172. {settfex-0.26.2 → settfex-0.27.0}/settfex/services/thaibma/yield_curve.py +0 -0
  173. {settfex-0.26.2 → settfex-0.27.0}/settfex/utils/__init__.py +0 -0
  174. {settfex-0.26.2 → settfex-0.27.0}/settfex/utils/data_fetcher.py +0 -0
  175. {settfex-0.26.2 → settfex-0.27.0}/settfex/utils/http.py +0 -0
  176. {settfex-0.26.2 → settfex-0.27.0}/settfex/utils/logging.py +0 -0
  177. {settfex-0.26.2 → settfex-0.27.0}/settfex/utils/parsing.py +0 -0
  178. {settfex-0.26.2 → settfex-0.27.0}/settfex/utils/session_cache.py +0 -0
  179. {settfex-0.26.2 → settfex-0.27.0}/settfex/utils/youtube_transcript.py +0 -0
  180. {settfex-0.26.2 → settfex-0.27.0}/tests/__init__.py +0 -0
  181. {settfex-0.26.2 → settfex-0.27.0}/tests/conftest.py +0 -0
  182. {settfex-0.26.2 → settfex-0.27.0}/tests/golden/model_contract/analyst_consensus.json +0 -0
  183. {settfex-0.26.2 → settfex-0.27.0}/tests/golden/model_contract/dr_profile.json +0 -0
  184. {settfex-0.26.2 → settfex-0.27.0}/tests/golden/model_contract/earnings_call_item.json +0 -0
  185. {settfex-0.26.2 → settfex-0.27.0}/tests/golden/model_contract/highlight_data.json +0 -0
  186. {settfex-0.26.2 → settfex-0.27.0}/tests/golden/model_contract/holiday_calendar.json +0 -0
  187. {settfex-0.26.2 → settfex-0.27.0}/tests/golden/model_contract/index_list_response.json +0 -0
  188. {settfex-0.26.2 → settfex-0.27.0}/tests/golden/model_contract/news_search_response.json +0 -0
  189. {settfex-0.26.2 → settfex-0.27.0}/tests/golden/model_contract/sec_company_match.json +0 -0
  190. {settfex-0.26.2 → settfex-0.27.0}/tests/golden/model_contract/sec_executive_trade.json +0 -0
  191. {settfex-0.26.2 → settfex-0.27.0}/tests/golden/model_contract/sec_executive_trade_report.json +0 -0
  192. {settfex-0.26.2 → settfex-0.27.0}/tests/golden/model_contract/stock_info.json +0 -0
  193. {settfex-0.26.2 → settfex-0.27.0}/tests/golden/model_contract/stock_list_response.json +0 -0
  194. {settfex-0.26.2 → settfex-0.27.0}/tests/golden/model_contract/tfex_series_list_response.json +0 -0
  195. {settfex-0.26.2 → settfex-0.27.0}/tests/golden/model_contract/tfex_trading_statistics.json +0 -0
  196. {settfex-0.26.2 → settfex-0.27.0}/tests/golden/model_contract/tfex_underlying_price.json +0 -0
  197. {settfex-0.26.2 → settfex-0.27.0}/tests/golden/model_contract/yield_curve.json +0 -0
  198. {settfex-0.26.2 → settfex-0.27.0}/tests/integration/__init__.py +0 -0
  199. {settfex-0.26.2 → settfex-0.27.0}/tests/integration/conftest.py +0 -0
  200. {settfex-0.26.2 → settfex-0.27.0}/tests/integration/test_live_endpoints.py +0 -0
  201. {settfex-0.26.2 → settfex-0.27.0}/tests/services/__init__.py +0 -0
  202. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/__init__.py +0 -0
  203. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/derive_r59_fixtures.py +0 -0
  204. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/derive_th_fixtures.py +0 -0
  205. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures.py +0 -0
  206. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/README.md +0 -0
  207. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/capital_indirection_en.html +0 -0
  208. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/en_mother_fs_h1_2025.html +0 -0
  209. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/en_ptt_56_1.html +0 -0
  210. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/en_ptt_56_2.html +0 -0
  211. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/en_ptt_fs_h1_2025.html +0 -0
  212. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/en_ptt_viewmore_56_2.html +0 -0
  213. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/idisc_505_error_page.html +0 -0
  214. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592000082610_th.json +0 -0
  215. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592000092610_th.json +0 -0
  216. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592000102610_th.json +0 -0
  217. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592000142610_th.json +0 -0
  218. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592000152610_th.json +0 -0
  219. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592000392610_th.json +0 -0
  220. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592000452610_th.json +0 -0
  221. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592000522610_th.json +0 -0
  222. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592000532609_th.json +0 -0
  223. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592000542609_th.json +0 -0
  224. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592001242610_th.json +0 -0
  225. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592001262610_th.json +0 -0
  226. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592001352609_th.json +0 -0
  227. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592001352610_th.json +0 -0
  228. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592001372609_th.json +0 -0
  229. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592001432610_en.json +0 -0
  230. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592001432610_th.json +0 -0
  231. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592002622609_th.json +0 -0
  232. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592002632609_th.json +0 -0
  233. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592002772609_th.json +0 -0
  234. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592002782609_th.json +0 -0
  235. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592002882609_th.json +0 -0
  236. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592002892609_th.json +0 -0
  237. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592003112609_th.json +0 -0
  238. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592003122609_th.json +0 -0
  239. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592003452609_th.json +0 -0
  240. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592003462609_th.json +0 -0
  241. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592003632609_th.json +0 -0
  242. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592003652609_th.json +0 -0
  243. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592004042609_th.json +0 -0
  244. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592004052609_th.json +0 -0
  245. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592004192609_th.json +0 -0
  246. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592004202609_th.json +0 -0
  247. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592004532609_th.json +0 -0
  248. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592004542609_th.json +0 -0
  249. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592004802609_th.json +0 -0
  250. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592004812609_th.json +0 -0
  251. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592004992609_th.json +0 -0
  252. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592005002609_th.json +0 -0
  253. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592005172609_th.json +0 -0
  254. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592005182609_th.json +0 -0
  255. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/detail_592005512609_th.json +0 -0
  256. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/en_default_20261007.html +0 -0
  257. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/th_capped_rcv_20261002.html +0 -0
  258. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/th_default_20261007.html +0 -0
  259. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/th_edge_rows.html +0 -0
  260. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/th_empty.html +0 -0
  261. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/th_kcg_txn_202609.html +0 -0
  262. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/th_sep_pairs.html +0 -0
  263. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/r59/th_spali_txn_202609.html +0 -0
  264. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/th_cpall_viewmore_56_1.html +0 -0
  265. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/th_mother_fs_h1_2025.html +0 -0
  266. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/th_ptt_56_1.html +0 -0
  267. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/th_ptt_56_2.html +0 -0
  268. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/fixtures_sec/th_ptt_fs_h1_2025.html +0 -0
  269. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/test_code_isolation.py +0 -0
  270. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/test_company.py +0 -0
  271. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/test_download.py +0 -0
  272. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/test_download_evidence.py +0 -0
  273. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/test_download_indirection.py +0 -0
  274. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/test_download_result.py +0 -0
  275. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/test_executive_trades.py +0 -0
  276. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/test_financial_report.py +0 -0
  277. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/test_financial_report_accounting.py +0 -0
  278. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/test_financial_report_th.py +0 -0
  279. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/test_listing_transport.py +0 -0
  280. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/test_sec.py +0 -0
  281. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/test_utils.py +0 -0
  282. {settfex-0.26.2 → settfex-0.27.0}/tests/services/sec/test_view_more_slugs.py +0 -0
  283. {settfex-0.26.2 → settfex-0.27.0}/tests/services/set/__init__.py +0 -0
  284. {settfex-0.26.2 → settfex-0.27.0}/tests/services/set/index/__init__.py +0 -0
  285. {settfex-0.26.2 → settfex-0.27.0}/tests/services/set/index/test_chart_quotation.py +0 -0
  286. {settfex-0.26.2 → settfex-0.27.0}/tests/services/set/index/test_composition.py +0 -0
  287. {settfex-0.26.2 → settfex-0.27.0}/tests/services/set/index/test_index.py +0 -0
  288. {settfex-0.26.2 → settfex-0.27.0}/tests/services/set/index/test_info.py +0 -0
  289. {settfex-0.26.2 → settfex-0.27.0}/tests/services/set/index/test_list.py +0 -0
  290. {settfex-0.26.2 → settfex-0.27.0}/tests/services/set/stock/__init__.py +0 -0
  291. {settfex-0.26.2 → settfex-0.27.0}/tests/services/set/stock/financial/__init__.py +0 -0
  292. {settfex-0.26.2 → settfex-0.27.0}/tests/services/set/stock/financial/test_financial.py +0 -0
  293. {settfex-0.26.2 → settfex-0.27.0}/tests/services/set/stock/test_analyst_consensus.py +0 -0
  294. {settfex-0.26.2 → settfex-0.27.0}/tests/services/set/stock/test_chart_quotation.py +0 -0
  295. {settfex-0.26.2 → settfex-0.27.0}/tests/services/set/stock/test_dr_indicative_price.py +0 -0
  296. {settfex-0.26.2 → settfex-0.27.0}/tests/services/set/stock/test_info.py +0 -0
  297. {settfex-0.26.2 → settfex-0.27.0}/tests/services/set/stock/test_latest_historical_trading.py +0 -0
  298. {settfex-0.26.2 → settfex-0.27.0}/tests/services/set/stock/test_profile_dr.py +0 -0
  299. {settfex-0.26.2 → settfex-0.27.0}/tests/services/set/test_asset_type.py +0 -0
  300. {settfex-0.26.2 → settfex-0.27.0}/tests/services/set/test_board_of_director.py +0 -0
  301. {settfex-0.26.2 → settfex-0.27.0}/tests/services/set/test_client.py +0 -0
  302. {settfex-0.26.2 → settfex-0.27.0}/tests/services/set/test_corporate_action.py +0 -0
  303. {settfex-0.26.2 → settfex-0.27.0}/tests/services/set/test_earnings_call.py +0 -0
  304. {settfex-0.26.2 → settfex-0.27.0}/tests/services/set/test_historical.py +0 -0
  305. {settfex-0.26.2 → settfex-0.27.0}/tests/services/set/test_list.py +0 -0
  306. {settfex-0.26.2 → settfex-0.27.0}/tests/services/set/test_listed_symbol.py +0 -0
  307. {settfex-0.26.2 → settfex-0.27.0}/tests/services/set/test_news.py +0 -0
  308. {settfex-0.26.2 → settfex-0.27.0}/tests/services/set/test_profile_company.py +0 -0
  309. {settfex-0.26.2 → settfex-0.27.0}/tests/services/set/test_realtime.py +0 -0
  310. {settfex-0.26.2 → settfex-0.27.0}/tests/services/set/test_shareholder.py +0 -0
  311. {settfex-0.26.2 → settfex-0.27.0}/tests/services/set/test_symbol_suggestion.py +0 -0
  312. {settfex-0.26.2 → settfex-0.27.0}/tests/services/test_fault_matrix.py +0 -0
  313. {settfex-0.26.2 → settfex-0.27.0}/tests/services/tfex/__init__.py +0 -0
  314. {settfex-0.26.2 → settfex-0.27.0}/tests/services/tfex/test_client.py +0 -0
  315. {settfex-0.26.2 → settfex-0.27.0}/tests/services/tfex/test_historical.py +0 -0
  316. {settfex-0.26.2 → settfex-0.27.0}/tests/services/tfex/test_list.py +0 -0
  317. {settfex-0.26.2 → settfex-0.27.0}/tests/services/tfex/test_realtime.py +0 -0
  318. {settfex-0.26.2 → settfex-0.27.0}/tests/services/tfex/test_trading_statistics.py +0 -0
  319. {settfex-0.26.2 → settfex-0.27.0}/tests/services/tfex/test_underlying_price.py +0 -0
  320. {settfex-0.26.2 → settfex-0.27.0}/tests/services/thaibma/__init__.py +0 -0
  321. {settfex-0.26.2 → settfex-0.27.0}/tests/services/thaibma/fixtures.py +0 -0
  322. {settfex-0.26.2 → settfex-0.27.0}/tests/services/thaibma/test_availability.py +0 -0
  323. {settfex-0.26.2 → settfex-0.27.0}/tests/services/thaibma/test_history.py +0 -0
  324. {settfex-0.26.2 → settfex-0.27.0}/tests/services/thaibma/test_thaibma.py +0 -0
  325. {settfex-0.26.2 → settfex-0.27.0}/tests/services/thaibma/test_utils.py +0 -0
  326. {settfex-0.26.2 → settfex-0.27.0}/tests/services/thaibma/test_yield_curve.py +0 -0
  327. {settfex-0.26.2 → settfex-0.27.0}/tests/test_deprecations.py +0 -0
  328. {settfex-0.26.2 → settfex-0.27.0}/tests/test_documented_exceptions.py +0 -0
  329. {settfex-0.26.2 → settfex-0.27.0}/tests/test_impersonate_target.py +0 -0
  330. {settfex-0.26.2 → settfex-0.27.0}/tests/test_model_contract.py +0 -0
  331. {settfex-0.26.2 → settfex-0.27.0}/tests/test_not_found_taxonomy.py +0 -0
  332. {settfex-0.26.2 → settfex-0.27.0}/tests/test_public_api_surface.py +0 -0
  333. {settfex-0.26.2 → settfex-0.27.0}/tests/test_readme_links.py +0 -0
  334. {settfex-0.26.2 → settfex-0.27.0}/tests/test_typing_surface.py +0 -0
  335. {settfex-0.26.2 → settfex-0.27.0}/tests/utils/__init__.py +0 -0
  336. {settfex-0.26.2 → settfex-0.27.0}/tests/utils/test_blocked_error.py +0 -0
  337. {settfex-0.26.2 → settfex-0.27.0}/tests/utils/test_data_fetcher.py +0 -0
  338. {settfex-0.26.2 → settfex-0.27.0}/tests/utils/test_formatting.py +0 -0
  339. {settfex-0.26.2 → settfex-0.27.0}/tests/utils/test_http.py +0 -0
  340. {settfex-0.26.2 → settfex-0.27.0}/tests/utils/test_logging.py +0 -0
  341. {settfex-0.26.2 → settfex-0.27.0}/tests/utils/test_logging_neighbourliness.py +0 -0
  342. {settfex-0.26.2 → settfex-0.27.0}/tests/utils/test_parsing.py +0 -0
  343. {settfex-0.26.2 → settfex-0.27.0}/tests/utils/test_session_cache.py +0 -0
  344. {settfex-0.26.2 → settfex-0.27.0}/tests/utils/test_validation.py +0 -0
  345. {settfex-0.26.2 → settfex-0.27.0}/tests/utils/test_youtube_transcript.py +0 -0
@@ -31,7 +31,7 @@ jobs:
31
31
  - uses: actions/checkout@v7
32
32
 
33
33
  # setup-uv stopped publishing floating major tags at v8 — pin the exact version.
34
- - uses: astral-sh/setup-uv@v10.2.0
34
+ - uses: astral-sh/setup-uv@v10.3.3
35
35
  with:
36
36
  # Pinned for reproducible builds — "latest" silently adopts whatever uv shipped
37
37
  # that day. Dependabot does not bump action *inputs*, so bump this by hand.
@@ -63,7 +63,7 @@ jobs:
63
63
  - uses: actions/checkout@v7
64
64
 
65
65
  # setup-uv stopped publishing floating major tags at v8 — pin the exact version.
66
- - uses: astral-sh/setup-uv@v10.2.0
66
+ - uses: astral-sh/setup-uv@v10.3.3
67
67
  with:
68
68
  # Pinned for reproducible builds — "latest" silently adopts whatever uv shipped
69
69
  # that day. Dependabot does not bump action *inputs*, so bump this by hand.
@@ -40,7 +40,7 @@ jobs:
40
40
  - uses: actions/checkout@v7
41
41
 
42
42
  # setup-uv stopped publishing floating major tags at v8 — pin the exact version.
43
- - uses: astral-sh/setup-uv@v10.2.0
43
+ - uses: astral-sh/setup-uv@v10.3.3
44
44
  with:
45
45
  # Pinned for reproducible builds — "latest" silently adopts whatever uv shipped
46
46
  # that day. Dependabot does not bump action *inputs*, so bump this by hand.
@@ -55,7 +55,7 @@ jobs:
55
55
  - uses: actions/checkout@v7
56
56
 
57
57
  # setup-uv stopped publishing floating major tags at v8 — pin the exact version.
58
- - uses: astral-sh/setup-uv@v10.2.0
58
+ - uses: astral-sh/setup-uv@v10.3.3
59
59
  with:
60
60
  # Pinned by hand like every other setup-uv step; the monthly drift report checks them all.
61
61
  version: "0.12.17"
@@ -34,7 +34,7 @@ jobs:
34
34
  - uses: actions/checkout@v7
35
35
 
36
36
  # setup-uv stopped publishing floating major tags at v8 — pin the exact version.
37
- - uses: astral-sh/setup-uv@v10.2.0
37
+ - uses: astral-sh/setup-uv@v10.3.3
38
38
  with:
39
39
  # Pinned for reproducible builds — "latest" silently adopts whatever uv shipped
40
40
  # that day. Dependabot does not bump action *inputs*, so bump this by hand.
@@ -87,7 +87,7 @@ jobs:
87
87
  - uses: actions/checkout@v7
88
88
 
89
89
  # setup-uv stopped publishing floating major tags at v8 — pin the exact version.
90
- - uses: astral-sh/setup-uv@v10.2.0
90
+ - uses: astral-sh/setup-uv@v10.3.3
91
91
  with:
92
92
  # Pinned for reproducible builds — "latest" silently adopts whatever uv shipped
93
93
  # that day. Dependabot does not bump action *inputs*, so bump this by hand.
@@ -114,7 +114,7 @@ jobs:
114
114
  - uses: actions/checkout@v7
115
115
 
116
116
  # setup-uv stopped publishing floating major tags at v8 — pin the exact version.
117
- - uses: astral-sh/setup-uv@v10.2.0
117
+ - uses: astral-sh/setup-uv@v10.3.3
118
118
  with:
119
119
  # Pinned for reproducible builds — "latest" silently adopts whatever uv shipped
120
120
  # that day. Dependabot does not bump action *inputs*, so bump this by hand.
@@ -20,7 +20,7 @@ jobs:
20
20
  - uses: actions/checkout@v7
21
21
 
22
22
  # setup-uv stopped publishing floating major tags at v8 — pin the exact version.
23
- - uses: astral-sh/setup-uv@v10.2.0
23
+ - uses: astral-sh/setup-uv@v10.3.3
24
24
  with:
25
25
  # Pinned for reproducible builds — "latest" silently adopts whatever uv shipped
26
26
  # that day. Dependabot does not bump action *inputs*, so bump this by hand.
@@ -50,7 +50,7 @@ jobs:
50
50
  - uses: actions/checkout@v7
51
51
 
52
52
  # setup-uv stopped publishing floating major tags at v8 — pin the exact version.
53
- - uses: astral-sh/setup-uv@v10.2.0
53
+ - uses: astral-sh/setup-uv@v10.3.3
54
54
  with:
55
55
  # Pinned for reproducible builds — "latest" silently adopts whatever uv shipped
56
56
  # that day. Dependabot does not bump action *inputs*, so bump this by hand.
@@ -339,10 +339,11 @@ Everything is importable from one place:
339
339
  ```python
340
340
  from settfex.exceptions import (
341
341
  # --- the cross-cutting catch: a name that does not exist (0.25.0) ---
342
- NotFoundError, # base of SymbolNotFoundError AND CompanyNotFoundError; never retry
342
+ NotFoundError, # base of Symbol-, Series- AND CompanyNotFoundError; never retry
343
343
  # --- the FETCH family: `except FetchError` catches all of these ---
344
344
  FetchError, # HTTP/transport failure; carries .status_code and .symbol
345
345
  HTTPStatusError, # a non-2xx, with .url and .report_code as data
346
+ SeriesNotFoundError, # TFEX 404: unknown series (0.27.0); an HTTPStatusError, never retry
346
347
  UnexpectedPageError, # a PAGE where a document was expected (0.26.0); carries the answer
347
348
  SoftNotFoundError, # its "file not found" page — can be FALSE; NOT a NotFoundError
348
349
  SymbolNotFoundError, # SET 404, or an unlisted analyst-consensus symbol; .suggestion
@@ -367,11 +368,12 @@ never is.** An input error means the request *succeeded* and your argument was w
367
368
  loop on one spins forever. `InvalidSymbolError`, `InvalidLanguageError` and `InvalidDateError` are
368
369
  raised before any network call at all.
369
370
 
370
- ⚠️ Two "not found" taxonomies still coexist: a SET 404 is a `SymbolNotFoundError` (a
371
- `FetchError`), while the SEC equivalent is a `CompanyNotFoundError` (a `ValueError`). Since 0.25.0
372
- both are also a **`NotFoundError`** — catch that one, and catch it **before** `FetchError`, because
373
- a `SymbolNotFoundError` is a `FetchError` too and a retry handler would otherwise retry a typo
374
- forever:
371
+ ⚠️ Several "not found" types still coexist. A SET 404 is a `SymbolNotFoundError` (a `FetchError`);
372
+ an unknown TFEX series is a `SeriesNotFoundError` (an `HTTPStatusError`, since 0.27.0; before that
373
+ a plain `HTTPStatusError(404)` that `except NotFoundError` missed); the SEC equivalent is a
374
+ `CompanyNotFoundError` (a `ValueError`). All of them are also a **`NotFoundError`**. Catch that
375
+ one, and catch it **before** `FetchError`: a `SymbolNotFoundError` or `SeriesNotFoundError` is a
376
+ `FetchError` too, and a retry handler would otherwise retry a typo forever:
375
377
 
376
378
  ```python
377
379
  try:
@@ -408,15 +410,19 @@ text:
408
410
 
409
411
  ---
410
412
 
411
- ### ⚠️ `get_holidays()` is broken upstream right now
413
+ ### ⚠️ `get_holidays()` fails intermittently upstream
412
414
 
413
- The SET holiday endpoint answers **HTTP 401 for the current year**, which is the only year it
414
- serves, so the call cannot succeed. This is an upstream change (since 2026-09-20), **not** a
415
- settfex defect, and no version fixes it — tracking: issue #140.
415
+ The SET holiday endpoint sometimes answers **HTTP 401 for the current year**, the only year it
416
+ serves. From 2026-09-20 settfex's own probes saw it repeatedly and reported it as a persistent
417
+ outage (issue #140). But a downstream poller running every 30 minutes succeeded at least once on
418
+ every LOGGED day from 2026-09-15 to 2026-11-02 (32 dates; days with no log carry no evidence either way), and all three calls on 2026-11-03 succeeded (2026: 20
419
+ holidays). So treat it as **available but unreliable**: a 401 can be an intermittent failure or an
420
+ unserved year, and the response looks the same in both cases.
416
421
 
417
- Since 0.24.1 it fails **immediately** instead of retrying for ~128 s, and the error message says
418
- so. Do not retry it, and do not report it as a library bug. If you need trading-day logic, you
419
- need another source for market closures; remember `is_holiday()` never covered weekends anyway.
422
+ Since 0.24.1 a 401 fails **immediately** instead of retrying for ~128 s. Do not retry it in a
423
+ loop (the endpoint degrades under polling), and do not report a 401 as a library bug. Keep another
424
+ source for market closures if trading-day logic depends on it; `is_holiday()` never covered
425
+ weekends anyway.
420
426
 
421
427
  ## Run it, don't hand it over
422
428
 
@@ -5,8 +5,162 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## Upgrading from 0.3.x, 0.15.x or 0.17.x
9
+
10
+ The 0.3, 0.15 and 0.17 lines received one last security release each (0.3.1, 0.15.1, 0.17.1, on
11
+ 2026-11-02, removing `diskcache`). They get no further fixes: the way forward is the latest release.
12
+ This section collects everything between those lines and the latest one that can change what your
13
+ code sees, so you do not have to read every release below. Most code needs no change at all.
14
+
15
+ **Verified 2026-11-03 against four downstream consumers** (TFEX trading statistics, underlying
16
+ price and series list; ThaiBMA yield curve; corporate actions; stock list; holidays). Each one's own
17
+ test suite passed unchanged on 0.26.3, and live calls through its own code returned the same fields
18
+ with the same types as on its pinned line. Concretely: the four suites (190, 1,899, 233 and 1,334 tests) passed
19
+ on both versions, and a live comparison after the TFEX day close (16:57-16:59 ICT) produced
20
+ identical output on both versions for every path: TFEX settlement and underlying price (S50X26),
21
+ the series list (762 series), trading statistics, corporate actions (CPALL), the ThaiBMA carry
22
+ rate, the stock list (3,605 SET rows) and the holiday calendar (20 holidays).
23
+
24
+ ### 1. Change the pin
25
+
26
+ - Lift any upper cap (e.g. `<0.18`), then `uv lock --upgrade-package settfex==<latest>`. Pin the
27
+ exact version: an open range would also take any later minor release unseen.
28
+ - `requires-python` is still `>=3.11`, and the runtime floors are unchanged (`curl-cffi>=0.6.0`,
29
+ `pydantic>=2.0.0`, `loguru>=0.7.0`). `diskcache` is no longer a dependency at all.
30
+
31
+ ### 2. What changes for everyone (no code change needed, but expect it)
32
+
33
+ - **One extra warm-up per site on the first run.** The session cache is a new store (0.26.1:
34
+ sqlite3 + JSON, nothing is unpickled), and since 0.26.3 cookies are cached with the domain they
35
+ were issued for. Older entries are treated as a miss, never guessed. The old
36
+ `~/.settfex/cache/cache.db` is never opened again; delete it if you like.
37
+ - **settfex is silent by default (0.24.2), and no longer removes your loguru handlers at import.**
38
+ Errors are still raised; only settfex's own log lines are off. To see them, call
39
+ `logger.enable("settfex")` after `import settfex`, or `setup_logger()`.
40
+ `setup_logger()` no longer prints frame locals in logged tracebacks (0.26.2).
41
+ - **Exceptions are typed (0.9.0) and only ever got wider.** Every settfex error is still an
42
+ `Exception`, so `except Exception` behaves as before. `ResponseParseError` is now also a
43
+ `FetchError` (0.24.0) and still a `ValueError`; `SymbolNotFoundError` is now also a
44
+ `NotFoundError` (0.25.0). If you retry on `FetchError`, catch `NotFoundError` first, and catch
45
+ `BlockedError` (a WAF block page, never worth retrying) before `ValueError`. Import exceptions
46
+ from `settfex.exceptions`. An unknown TFEX series raises `SeriesNotFoundError` from 0.27.0
47
+ (still an `HTTPStatusError`, now also a `NotFoundError`).
48
+ - **New keyword parameters were appended, with defaults**, e.g. `get_stock_list(include_indices=...)`
49
+ and `setup_logger(filter=...)`. No parameter was renamed or reordered on these lines' functions.
50
+
51
+ ### 3. Only if you use these
52
+
53
+ - **`get_stock_list()`** (from 0.3.x only): since 0.8.0 each stock is enriched with its index
54
+ membership by default, which costs extra requests. `include_indices=False` gives the 0.3 behaviour.
55
+ - **`get_holidays()`**: a 401 is no longer retried (0.24.1), so it fails in seconds rather than
56
+ minutes. The endpoint answers 401 for the current year **intermittently**, on every version
57
+ (#140): reported as persistent from 2026-09-20, yet a 30-minute poller succeeded at least once
58
+ on every logged day. Retry later, and keep a fallback.
59
+ - **Company profile** (from 0.3.x only): `Management.start_date` can be `None` (0.10.1). Guard
60
+ before `.strftime()`.
61
+ - **`to_dataframe()`** with pandas 3 (0.19.0): missing values are `NaN`, not `None`. Use
62
+ `pd.isna()`.
63
+ - **`Stock.get_latest_price()`** (from 0.15.x): DR symbols return the TradingView indicative price
64
+ by default (0.16.0); pass `prefer_dr_indicative=False` for the SET chart path.
65
+ - **SEC documents** (`settfex.services.sec`): read the **Migration** list under 0.24.0 below.
66
+ `SecDocumentList` and `DownloadResult` are Pydantic models (`isinstance(x, list)` is now
67
+ `False`); name lookups need `allow_name_match=True`; the incidental re-export
68
+ `settfex.services.sec.sec.SymbolNotFoundError` is gone (`CompanyNotFoundError` from
69
+ `settfex.exceptions`).
70
+ - **Analyst consensus**: an unknown symbol raises `SymbolNotFoundError` (0.25.0 per-symbol table,
71
+ 0.26.0 overall summary).
72
+ - **Building response models by hand**: `IndexListResponse.indices` and
73
+ `IndexInfoListResponse.index_industry_sectors` became required (0.24.0); an empty list is fine.
74
+
75
+ ### 4. Check it
76
+
77
+ Run your own test suite on the new pin, then make one live call through each settfex function you
78
+ use and compare the fields you read. That is how the verification above was done.
79
+
8
80
  ## [Unreleased]
9
81
 
82
+ ## [0.27.0] - 2026-11-04
83
+
84
+ An unknown TFEX series gets its own "not found" error, and the holiday docs stop calling a
85
+ working endpoint dead. **Additive:** nothing a 0.26.x caller catches stops catching.
86
+
87
+ ### Added
88
+
89
+ - **`SeriesNotFoundError`** (`settfex.exceptions`), raised by `get_trading_statistics()` and
90
+ `get_underlying_price()` (and their service and `_raw` methods) when TFEX answers **HTTP 404**,
91
+ i.e. the series symbol is unknown. Live-probed 2026-11-03: `ZZZZ99` answers 404 on both
92
+ endpoints. Until now that reached callers as a plain `HTTPStatusError(404)`, while SET stock
93
+ endpoints raise `SymbolNotFoundError`. So `except NotFoundError`, the library-wide "do not
94
+ retry" catch, caught a bad stock symbol and silently missed every bad TFEX series. A downstream
95
+ consumer nearly shipped exactly that catch.
96
+ - It is `SeriesNotFoundError(HTTPStatusError, NotFoundError)`: a **strict subclass** of what was
97
+ raised before, keeping `status_code`, `url` and `symbol`. So every `except HTTPStatusError` /
98
+ `except FetchError` still catches it. Additive under the deprecation policy, hence a minor
99
+ release and no warning period.
100
+ - Keying on `exc.status_code == 404` works on every version.
101
+ - Only a 404 is converted; every other status stays a plain `HTTPStatusError`, so a 503 is never
102
+ mistaken for "does not exist". The series **list** takes no symbol, so its 404 means a wrong
103
+ route and is unchanged.
104
+ - ⚠️ settfex's `HTTPStatusError` has the **same name** as httpx's and is a different class; import
105
+ it from `settfex.exceptions`. A downstream consumer's `except httpx.HTTPStatusError` had never
106
+ fired.
107
+
108
+ ### Fixed
109
+
110
+ - **A test fixture that expired with the cookie it copied** (`tests/utils/test_session_manager.py`,
111
+ test-only). 0.26.3's cookie tests used the absolute expiry timestamps of a live 2026-11-02 jar,
112
+ and `charlot`'s (a ~1-day cookie) passed at 2026-11-03 20:42 ICT. An expired cookie is dropped
113
+ from the jar, so the leak test failed on main the next day with no code change. Expiries are now
114
+ relative to the test's own clock, with the live lifetimes kept (~1 day, ~1 year, session). The
115
+ library was never affected.
116
+
117
+ ### Changed
118
+
119
+ - **`get_holidays()`'s 401 message no longer says the endpoint is down.** It said that since
120
+ 2026-09-20 the endpoint "has answered 401 for the CURRENT year", and README and AGENTS.md said
121
+ the call "cannot succeed". Both claims came from settfex's own probes (#140, closed as
122
+ persistent). But a downstream consumer's poller, running every 30 minutes, banked at least one
123
+ successful response on every logged day from 2026-09-15 to 2026-11-02 (32 dates; first reported
124
+ as 36, recounted), and three live calls on 2026-11-03 (on 0.15.1 and 0.26.3) all returned 2026's
125
+ 20 holidays. The current-year 401 is **intermittent, not persistent**. The message now says so,
126
+ and says to retry later rather than in a loop: the endpoint degrades under polling, so a 401 is
127
+ still not retried internally.
128
+
129
+ ### Documentation
130
+
131
+ - **"Upgrading from 0.3.x, 0.15.x or 0.17.x"** at the top of this file. It collects everything
132
+ between those lines and the latest release that can change what calling code sees. Built from
133
+ a mechanical diff of the public API (functions, parameters, model fields and exception classes,
134
+ with annotation-only changes ignored) and checked against four downstream consumers.
135
+ - An **Errors** table in `docs/settfex/services/tfex/trading_statistics.md`.
136
+
137
+ ## [0.26.3] - 2026-11-02
138
+
139
+ Cookie hardening for the session cache. No API change; one extra warm-up per site after upgrading.
140
+
141
+ ### Security
142
+
143
+ - **A cached session's cookies are sent only to the domain they were issued for**
144
+ (`settfex.utils.session_manager`). The cache kept only name → value, and a restore set each
145
+ cookie with **no domain**. curl_cffi binds a domain-less cookie to the host of the first request
146
+ that carries it, so the first request after a restore decided where a site's cookies went, even to
147
+ a foreign host. A loopback test (two hostnames resolved to 127.0.0.1) showed the restored SET
148
+ cookies reaching `attacker.example` on 0.26.2.
149
+ - The cache now stores each cookie's domain, host-only flag, path, secure flag and expiry
150
+ (`cookie_jar`), and a restore rebuilds exactly that. It keeps writing the plain `cookies` map, so
151
+ 0.26.1/0.26.2 processes sharing the directory still read it.
152
+ - An entry from 0.26.2 or older (no `cookie_jar`) is a cache miss: one anonymous warm-up after
153
+ upgrading, then the row is rewritten. So is a row holding a malformed cookie or one outside the
154
+ site's own domain (`set.or.th`, `tfex.co.th`, `settrade.com`).
155
+ - Verified live on 2026-11-02, 12 requests in all. First, one warm-up per site showed what each
156
+ site issues: `.set.or.th` / `.tfex.co.th` / `.settrade.com`, plus a host-only `charlot` on the
157
+ `www.` host. Then a cold process (warm-up, save, one real call per site) and a second process
158
+ restoring from that cache with no warm-up; all six calls returned data.
159
+ - **`get_session_for_url()` matches the URL's hostname, not a substring of the whole URL.**
160
+ `https://evil.example/?next=www.settrade.com` used to route to the Settrade session, and
161
+ `settrade.com.evil.example` would have too. A host must now equal the site's domain or be a
162
+ subdomain of it; anything else uses the SET session, as before.
163
+
10
164
  ## [0.26.2] - 2026-11-02
11
165
 
12
166
  Two logging fixes, and a Security workflow that now audits every extra. No API change.
@@ -398,7 +398,20 @@ dependency refresh; the enforcement tests it references live in `tests/`.)
398
398
  breaks settfex (justify either in `CHANGELOG.md`). Upgrades move `uv.lock`, not the floors.
399
399
  - **Cadence & detection:** Dependabot proposes bumps weekly; the `dependency-drift.yml`
400
400
  workflow posts a monthly whole-picture outdated report as a standing issue. `uv lock --check`
401
- in CI fails any commit whose lock is stale vs `pyproject.toml`.
401
+ in CI fails any commit whose lock is stale vs `pyproject.toml`. **Dependabot alerts and
402
+ security updates are ON (since 2026-11-03, operator-approved).** Before that only version
403
+ updates ran, and advisories surfaced only through pip-audit. The dependency graph reads the
404
+ whole `uv.lock`, extras included (190 packages, tornado among them), so an alert can fire for a
405
+ package only the `examples` extra pulls in. Security-update PRs arrive outside the Monday batch.
406
+ - **Merging several Dependabot lock PRs:** they merge as TEXT without conflicting (each makes the
407
+ same header edit) and Dependabot never rebases after a sibling lands, so the combined
408
+ `uv.lock` on main is a state no single PR's CI tested. Merge them all into a temporary branch
409
+ first, run the full gates plus `pip-audit` over every extra (and smoke-test the `examples`
410
+ extra, which CI never installs), then merge on GitHub in the same order and confirm main's
411
+ `uv.lock` blob equals the tested one (`git rev-parse <ref>:uv.lock`). Ask Dependabot to rebase
412
+ (`@dependabot rebase`) any PR whose base predates a lock change. Dependabot's uv also rewrites
413
+ the lock header from `revision = 3` to `5`; uv 0.12.17 reads both. (Done this way for
414
+ #160/#162/#169-#172 on 2026-11-03; learned from the tvkit repo.)
402
415
  - **Upgrade protocol:** one package per commit — `uv lock --upgrade-package <name>==<target>`,
403
416
  then the full gates (`pytest`, `ruff check`, `ruff format --check`, `mypy settfex/`); the lock
404
417
  diff must move only the named package + its dependency closure, enumerated in the commit body.
@@ -509,7 +522,7 @@ See [`CHANGELOG.md`](CHANGELOG.md) for the full, versioned release history — t
509
522
  - **Holiday endpoint lives on a different path prefix:** `/api/cms/v1/holidays/year/{year}` is the **only** `/api/cms/v1/` endpoint in the package — everything else on `www.set.or.th` is under `/api/set/`. It takes `?lang=` (like stock/news), **not** `?language=` (like index).
510
523
  - **The holiday endpoint serves ONLY the current year:** live-probed 2026-07-27 — with 2026 returning HTTP 200 on every interleaved control request, **2024, 2025, 2027 and 2028 all returned HTTP 401**. There is no history and no next-year lookahead, so this endpoint alone cannot back a multi-year trading calendar or a backtest.
511
524
  - **HTTP 401 is the holiday endpoint's only failure code — and it is ambiguous:** an unrecognized `lang`, a missing `lang`, and an unserved year all return a bare `401` with an **empty body**, and so do valid requests *transiently*. Success degrades the harder you poll (~100% cold → ~35% after ~50 requests → ~12% after ~150), recovering on its own when left idle. `HolidayService` therefore retries 401/403/429 itself with exponential backoff (`FetcherConfig.max_retries`/`retry_delay`) — note `AsyncDataFetcher.fetch()` retries **exceptions only**, never a non-2xx status, so any other service is one flaky response away from a hard failure.
512
- - **`get_holidays()` is BROKEN UPSTREAM since 2026-09-20, and no settfex change can fix it (issue #140):** the endpoint answers **HTTP 401 for the CURRENT year** — and the current year is the only year it serves, so nothing is left that works. Re-tested 2026-09-21 at 17:05 and 17:10 ICT after a >24-hour cooldown: both 401, which is what separates a change from this endpoint's documented transient 401. Not a client regression — identical on 0.23.0 and 0.24.0rc1, four runs, runtimes within 1.3 s. ⚠️ **401 is no longer retried (0.24.1).** It was, because 401 is also the transient code — but this endpoint *degrades under polling* (~100% cold → ~35% after ~50 requests → ~12% after ~150), so the ladder lowered the odds of its own next attempt while costing ~128 s per call. `403`/`429` are still retried. The raised type is unchanged (`FetchError`, `status_code=401`), so this stayed a patch.
525
+ - **`get_holidays()`'s current-year 401 is INTERMITTENT, not persistent — ➡️ CORRECTED 2026-11-03; this answers "is the endpoint down?" (no: unreliable)** (issue #140 recorded it as PERSISTENT_401 from 2026-09-20; a downstream consumer's poller, running every 30 minutes, banked at least one successful response on every logged day from 2026-09-15 to 2026-11-02 (32 dates — first reported as 36, recounted by its owner; the 2026-10-13/16/23 closures have no log, so they carry no evidence either way) — with no fallback in that write path — and 3 of 3 calls on 2026-11-03 at ~16:58 ICT returned 2026's 20 holidays. What the record cannot give is a success RATE: failures there log at DEBUG. UNPROVEN: whether a warm cached cookie is what let the poller through while cold probes got 401.) The original record, kept as history — read "persistent" below as "seen repeatedly by settfex's probes": the endpoint answers **HTTP 401 for the CURRENT year** — and the current year is the only year it serves, so nothing is left that works. Re-tested 2026-09-21 at 17:05 and 17:10 ICT after a >24-hour cooldown: both 401, which is what separates a change from this endpoint's documented transient 401. Not a client regression — identical on 0.23.0 and 0.24.0rc1, four runs, runtimes within 1.3 s. ⚠️ **401 is no longer retried (0.24.1).** It was, because 401 is also the transient code — but this endpoint *degrades under polling* (~100% cold → ~35% after ~50 requests → ~12% after ~150), so the ladder lowered the odds of its own next attempt while costing ~128 s per call. `403`/`429` are still retried. The raised type is unchanged (`FetchError`, `status_code=401`), so this stayed a patch.
513
526
  - **`HolidayCalendar.is_holiday()` is not "is the market open":** the API returns published closures only, so weekends are absent and `is_holiday(saturday)` is `False`. It also expresses whole-day closures only — no field for partial sessions or altered hours. Weekend logic must live in the caller.
514
527
  - **Do not enable `str_strip_whitespace` on `Holiday`:** unlike every other SET model, it is deliberately off — a trailing `" *"` in a description is a SET footnote marker for additional special closures and must survive verbatim (a test guards this).
515
528
  - **SEC listings are BILINGUAL now, and the Thai page is not a translation of the English one:** `lang="th"` used to return an empty list for every issuer — `category_for_section` probed English substrings only, so every Thai heading fell through to `None` and `row_to_document` dropped the row at its first statement, with no exception, no warning and no DEBUG line (issue #123, fixed 2026-09-19). Classification and the header map are now bilingual and the Thai half is an exact **mirror** of the English half — same fields, no more and no fewer — so the same query in either language yields the same documents. Two live traps if you touch `_section_disposition`: (1) **order is load-bearing** — the Thai heading for statements *being revised* (`งบการเงินที่อยู่ระหว่างการแก้ไข`) **contains** the heading for financial statements (`งบการเงิน`) as a prefix, so the skip tokens must be tested first or every amended-statement section files under `FINANCIAL_STATEMENT`; (2) `รายละเอียด` is **one Thai word for three English headers** (Details/Link/Description) and appears **twice in one header row** on the ordered-to-amend table — all three are unmapped in English, so "no entry" is right in all three places. **Do not add it to `_HEADER_FIELD_MAP`.**
@@ -522,6 +535,7 @@ See [`CHANGELOG.md`](CHANGELOG.md) for the full, versioned release history — t
522
535
  - **The uv version in CI is pinned by hand — Dependabot will not bump it:** all nine `astral-sh/setup-uv` steps (`ci.yml` ×2, `release.yml` ×2, `security.yml` ×2, `dependency-drift.yml` ×1, `pre-commit.yml` ×1, `live-smoke.yml` ×1) pass `version: "0.12.17"` instead of `"latest"`, so a uv release cannot silently change a build (this matters most in `release.yml`, which builds the published artifact). Dependabot's `github-actions` ecosystem bumps the *action ref*, never an action *input*, so this pin only moves when someone edits it — the monthly drift report flags it against the latest uv release (and flags any of the steps disagreeing with each other; it counts them itself), but flagging is all it does. Note pinning does **not** make setup-uv network-free: on a GitHub-hosted runner uv is not in the tool cache, so `getArtifact` still fetches `raw.githubusercontent.com/astral-sh/versions` for the download URL — a fetch that has been observed to fail transiently. Re-run the job when it does. (Bumped 0.11.33 → 0.12.17 on 2026-09-19. uv 0.12 is a **breaking** minor line — PEP 625 sdist formats and some wheel entry points are now rejected, *including when referenced by an existing lockfile* — so the pin was moved only after running every uv command CI runs against the real tree: `lock --check` (the lock is accepted unchanged), `sync --frozen`, the four gates, `run python -m build` + the py.typed wheel assertion, bandit and pip-audit. A green unit suite alone would not have covered the release path.)
523
536
  - **Ruff is UNFROZEN (since 2026-08-31, at 0.16.5; the live pin is `uv.lock` + `.pre-commit-config.yaml`, not this sentence) — Markdown is permanently excluded via `extend-exclude = ["*.md"]`:** ruff 0.16+ formats Python code blocks inside Markdown by default, which would collapse the intentionally column-aligned inline comments in ~40 doc files (`CLAUDE.md`, `README.md`, `AGENTS.md`, `docs/`) — the reason ruff was frozen at 0.13.2 from 2026-08-25 to 2026-08-31 (Dependabot bumps rejected 3×: #61 → #78 → #88). The freeze's deferred question was settled by the `extend-exclude = ["*.md"]` line under `[tool.ruff]`: it preserves pre-0.16 behavior byte-identically (0.13.2 never touched `.md`), so **do not remove it** when tidying config. A ruff bump is a **2-place change**: the dev-group lock (`uv lock -P ruff==X`) and the `rev:` in `.pre-commit-config.yaml` — keep them in lockstep. Note Dependabot STILL never proposes ruff bumps (the `@dependabot ignore` from PR #88 lives in Dependabot's server-side state and was deliberately left in place); the monthly dependency-drift workflow reports ruff staleness instead, and bumps are applied by hand. That report also checks the two places agree, because a half-applied 2-place change fails nothing on its own.
524
537
  - **Classify asset types by `securityType` CODE, never by `securityTypeName`:** the API's own display name for code `Q` carries a typo ("Prefered Foreign Stocks"), and names are localizable. `AssetType.from_security_type()` maps codes case-insensitively and returns `UNKNOWN` for anything new (never raises). There is deliberately no `AssetType.BOND` — bonds appear nowhere in SET's stock APIs (no `/api/set/bond/list`, none in the stock list; live-probed 2026-08-03).
538
+ - **An unknown TFEX series is `SeriesNotFoundError` (0.27.0), not `SymbolNotFoundError` — key on the class hierarchy, not the name:** both per-series endpoints (trading-statistics, underlying-price) answer an unknown series with HTTP 404 (live 2026-11-03, `ZZZZ99`); `AsyncDataFetcher.fetch_json` raises the generic `HTTPStatusError` for every non-2xx, and `services/tfex/_series.fetch_series_json` converts **only the 404** into `SeriesNotFoundError(HTTPStatusError, NotFoundError)`. It must stay a STRICT SUBCLASS of `HTTPStatusError` — that is what makes it additive (every 0.26.x `except HTTPStatusError` still catches it). The series LIST endpoint takes no symbol and keeps the plain `HTTPStatusError` (a 404 there is a wrong route). ⚠️ settfex's `HTTPStatusError` shares its NAME with httpx's — a consumer's `except httpx.HTTPStatusError` never fired (a downstream 503-instead-of-404 bug); tell callers to import from `settfex.exceptions`.
525
539
  - **The DR-profile endpoint 404s for perfectly valid non-DR symbols:** `/api/set/dr/{sym}/profile` answers ANY non-DR (even `CPALL`) with HTTP 404 `{"message":"Invalid DR"}` — so the service raises `SymbolNotFoundError` with `suggest=False`; letting the symbol suggester run would produce the absurd "'CPALL' not found — did you mean 'CPALL'?". A 404 here means "not a DR", not "unknown symbol".
526
540
  - **`indicativePriceSymbol` is sometimes null while `indicativePriceUrl` is not:** several DRs (HERMES80, BYDCOM80, NDX01 in live probes) return `indicativePriceSymbol: null` but still carry the full expression URL-encoded in `indicativePriceUrl`'s `symbol` query param. `DrProfile.indicative_expression` recovers it from the URL automatically — don't treat a null symbol field as "no expression".
527
541
  - **TradingView scanner is a stateless foreign host — and `lp` is a websocket-only column:** never route `scanner.tradingview.com` through SessionManager (auto-detect would mis-warm it as SET, and the batch scan is a POST, which persistent sessions don't support) — `DrIndicativePriceService` forces `use_session=False` for TV calls only. Over plain HTTP request the `close` column for the last price (~15-min delayed for exchange legs, `update_mode: delayed_streaming_900`; FX_IDC legs stream); `lp`/`lp_time`/`last_price` come back null. Unknown tickers return HTTP 200 with the row simply missing (the service raises `FetchError` for missing rows). Remember `AsyncDataFetcher.fetch()` retries exceptions only — the service checks the status explicitly.
@@ -550,6 +564,7 @@ See [`CHANGELOG.md`](CHANGELOG.md) for the full, versioned release history — t
550
564
  - **Over plain HTTP the quote block serves the BEST bid/offer level only:** `bids`/`offers` come back with one entry each, not the 5-level ladder shown on the set.or.th page (that depth is websocket-fed). Ladder `price` arrives as a **string** (`"44.75"`) and is coerced by the shared `BidOffer` model, which `stock/info.py` imports from `index/composition.py` rather than duplicating.
551
565
  - **A stock-info 404 means "unknown symbol" — unlike the DR-profile 404:** `/api/set/stock/{sym}/info` answers an unknown ticker with HTTP 404 `{"message": "Invalid Stock Name"}` and resolves every real one, so `SymbolNotFoundError` is raised **with** the "did you mean?" suggester enabled (the opposite of `/api/set/dr/{sym}/profile`, which 404s for valid non-DRs and must pass `suggest=False`).
552
566
  - **The session cache no longer unpickles (0.26.1) — and the `0700` rule stays, for a different reason:** until 0.26.1 the store was `diskcache`, which reads values back with **pickle** (CVE-2025-69872 / PYSEC-2026-2447, **no fixed release**, upstream dormant since 2023), so write access to `~/.settfex/cache` was code execution in the caller's process, and every consumer's pip-audit flagged it on a *runtime* dependency. `settfex/utils/session_cache.py` is now stdlib **`sqlite3` holding JSON text** (`sessions.sqlite3`, WAL, created `0600`): `json.loads` on read, a row that is not a JSON object is a miss, and the old `cache.db` is **never opened** (one extra warm-up after upgrading; an INFO line says it can be deleted). The public API is unchanged. **Do not reintroduce a pickling store.** The directory rule is unchanged because the cookies are credentials: `_secure_cache_dir()` creates it `0700` and **chmods an existing default one in place** (logged at INFO); a directory the caller passed is created `0700` when new but, if it already exists group/other-writable, is **reported and left alone** — a shared cache can be deliberate. Windows is skipped (POSIX bits do not express this), and every permission step is inside `try/except OSError`. Tests pin the permissions, the no-unpickle property and the store's behaviour in `tests/utils/test_session_cache.py`.
567
+ - **Cached cookies are restored WITH their domain (0.26.3) — never restore one without it:** curl_cffi binds a domain-less cookie to the host of the FIRST request that carries it (`Cookies.get_cookies_for_curl` fills an empty domain from the current request), so until 0.26.3 — when the cache kept name → value only — the first request after a restore decided where a site's Incapsula cookies went, foreign host included (a loopback test proved it). The cache row now carries `cookie_jar` (domain, host-only flag, path, secure, expiry) and `_cookie_from_cache` rebuilds an exact `http.cookiejar.Cookie`; a row without it (≤ 0.26.2), with a malformed cookie, or with a domain outside the site's own is a **miss**, never a guess. The plain `cookies` map is still written for 0.26.1/0.26.2 readers. Live shape (2026-11-02): `.set.or.th` / `.tfex.co.th` / `.settrade.com` for `visid_incap_*`/`incap_ses_*`, host-only `www.<site>` for `charlot`. ⚠️ **Test trap:** with plain `localhost` vs `127.0.0.1` as the two hosts a domain-less cookie reaches NEITHER — use dotted names via `CURLOPT_RESOLVE`. `get_session_for_url()` likewise matches the **hostname** (equal or subdomain), not a substring of the URL.
553
568
  - **SEC serves FOUR download-URL shapes; two of them were silently dropping live filings:** `classify_download_href` knew `Download?FILEID=<path>` and `ipos/Common/IPOSGetFile.aspx?id=`. **Key Financial Ratio** rows use two more, and both fell through to "not a download link" and made the row vanish — live-probed 2026-09-20 on CPALL, both real downloads: (1) recent rows (2026 Q1/Q2) link through `/public/idisc/Views/FinancialStatementDownload?query=<opaque base64>`, answering `application/zip` — a **134 KB zip of the real PDFs**; (2) older rows (2018, 2019) link through `/public/idisc/views/viewdoc?…&TransId=<id>&FileSeq=<n>`, answering `application/.tif` — a **36 KB scan of the original**. Mapped now as `file_id="fsdl:<blob>"` / `"viewdoc:<id>-<n>"`, both `file_kind=None` (neither URL states a type; `Content-Disposition` names the file at download time). After the fix, CPALL 2015-2026 returns **177 documents with `completeness()` exact in all five categories** — `key_financial_ratio` was `(13, 15)`. ⚠️ **Three things this should teach the next reader.** (a) **It falsifies the reporting issue's own finding:** its corpus scan of 39 captured pages found *zero* natural instances of a dropped row and stated P1 "has not been observed in the wild"; the first two live runs of the new accounting found four. A captured corpus can only show what was captured. (b) **The window is load-bearing:** a narrow recent window passed clean while the 2018/2019 rows were being dropped — **old filings use old URL shapes**, so a probe that only checks recent data cannot see them. (c) **Do NOT generalise the allowlist** into "any link under /public/idisc/ with a query is a download": the "display all results" ViewMore link has exactly that shape, and would become a phantom filing in every truncated section. Expect the list to grow; `ListingAccounting.no_link` is the mechanism that makes the next one visible, and a test pins the ViewMore link as not-a-download. Note `_fallback_filename` keys on the **colon**, not on an `ipos:` prefix: a real FILEID path never contains one, so every synthetic id is safely excluded from being sliced like a path.
554
569
  - **The SEC LISTING path checks its HTTP status now — and a ViewMore failure DEGRADES rather than raising (issue #131):** `_run_search` used to return `post_resp.text` without ever reading `status_code`, so an error page parsed to zero rows and came back as `[]` with `has_losses == False` — indistinguishable from an issuer that filed nothing, and intermittent, so a backfill recorded the window as covered. Evidenced by a real **HTTP 505** from the listing host (2026-09-20). Two rules: non-2xx → `FetchError`; a 2xx body with **no result table and no section heading** → `ParseError`. The content rule is deliberately the weakest one that separates the populations, because the case it must never trip is a **genuinely empty listing** — a test pins it against every page this repo holds. It does **not** key on `ctl00_CPH_pnlControl`: the real ViewMore capture has that id and the trimmed `FS_VIEWMORE_HTML` constant does not, so a panel-id rule would call a legitimate page an error. ⚠️ **The severity ladder differs by leg, on purpose.** The POST leg raises (a total loss — nothing to fall back on). A **ViewMore** page is different: it *replaces* its section's inline rows, so 0.22.0's unconditional replacement meant a failing page **deleted the whole section, inline rows included, in silence**. A broken ViewMore is a *partial* loss, so it now keeps the inline rows, warns, and lets `completeness()` show the shortfall. `_map_rows` additionally refuses a **zero-row** input: within this package that can only be a non-listing body, since every captured page carries at least the placeholder row an empty section serves. ⚠️ **U-7 (0.25.0): a ViewMore page must never REDUCE the row set — and until 0.25.0 a *successful* one could.** Two ways, both silent: (1) a page that mapped to fewer documents than the inline rows replaced them anyway (no comparison), so a short or placeholder-only page deleted rows with `has_losses` still `False`; (2) a page whose `_map_rows` raised (`ParseError`/`IncompleteListingError`) escaped the loop, and the per-code gather then failed the **whole report code**, taking every sibling category's inline rows with it. Both now degrade exactly like an unusable page (`DegradedSection`, inline rows kept). The rule is a **count** (ViewMore docs for the category ≥ inline docs), **not identity** — a superset check by file id would flip the synthetic test pairs and misfire on `fsdl:` ids, which may be minted per request. On the degrade path `reported.update`/`supersede` are skipped, so `is_balanced` holds and the inline page's reported count stays for `completeness()`; on the replace path only the replaced category's reported count moves.
555
570
  - **The live Thai `fs-kf` ViewMore page has been answering HTTP 500 since at least 2026-09-20 — an UPSTREAM bug, and it is why the degrade path exists:** probed 3× each, `th/fs-kf` returned 500 every time while `th/fs-norm`, `th/fs-mda` and all three `en/*` returned 200. On 0.22.0 this silently removed CPALL's entire Thai Key Financial Ratio section; now the listing returns 177 documents with `key_financial_ratio: (10, 15)` stated in `completeness()` plus two WARNINGs. **If you see a Thai KFR shortfall, check whether SEC has fixed their page before looking in settfex.**
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: settfex
3
- Version: 0.26.2
3
+ Version: 0.27.0
4
4
  Summary: Async Python library for fetching real-time and historical data from the Stock Exchange of Thailand (SET) and Thailand Futures Exchange (TFEX)
5
5
  Project-URL: Homepage, https://github.com/lumduan/settfex
6
6
  Project-URL: Documentation, https://github.com/lumduan/settfex#readme
@@ -135,10 +135,13 @@ logger.enable("settfex") # AFTER `import settfex` — see the note abov
135
135
  than the SET-listed `PMC LABEL MATERIAL`. Verify by comparing `company_name` against the issuer
136
136
  you intended; re-resolving and comparing `unique_id` proves only that resolution is
137
137
  deterministic. A caller-side check is proposed for 0.25.0.
138
- - **`get_holidays()` currently fails** — the SET holiday endpoint answers HTTP 401 for the current
139
- year, which is the only year it serves. This is an **upstream change, not a settfex defect**, and
140
- upgrading does not fix it. Since 0.24.1 the call fails immediately rather than retrying for
141
- ~128 s. Tracking: [#140](https://github.com/lumduan/settfex/issues/140).
138
+ - **`get_holidays()` fails intermittently, upstream** — the SET holiday endpoint sometimes
139
+ answers HTTP 401 for the current year (the only year it serves), which no settfex version can
140
+ fix. From 2026-09-20 this was reported as a persistent outage
141
+ ([#140](https://github.com/lumduan/settfex/issues/140)), but a downstream poller running every
142
+ 30 minutes succeeded at least once on every logged day (32 dates), and every call on 2026-11-03 succeeded. Since
143
+ 0.24.1 a 401 fails immediately rather than retrying for ~128 s: try again later, and keep a
144
+ fallback for market closures.
142
145
 
143
146
  ## Versioning policy
144
147
 
@@ -89,10 +89,13 @@ logger.enable("settfex") # AFTER `import settfex` — see the note abov
89
89
  than the SET-listed `PMC LABEL MATERIAL`. Verify by comparing `company_name` against the issuer
90
90
  you intended; re-resolving and comparing `unique_id` proves only that resolution is
91
91
  deterministic. A caller-side check is proposed for 0.25.0.
92
- - **`get_holidays()` currently fails** — the SET holiday endpoint answers HTTP 401 for the current
93
- year, which is the only year it serves. This is an **upstream change, not a settfex defect**, and
94
- upgrading does not fix it. Since 0.24.1 the call fails immediately rather than retrying for
95
- ~128 s. Tracking: [#140](https://github.com/lumduan/settfex/issues/140).
92
+ - **`get_holidays()` fails intermittently, upstream** — the SET holiday endpoint sometimes
93
+ answers HTTP 401 for the current year (the only year it serves), which no settfex version can
94
+ fix. From 2026-09-20 this was reported as a persistent outage
95
+ ([#140](https://github.com/lumduan/settfex/issues/140)), but a downstream poller running every
96
+ 30 minutes succeeded at least once on every logged day (32 dates), and every call on 2026-11-03 succeeded. Since
97
+ 0.24.1 a 401 fails immediately rather than retrying for ~128 s: try again later, and keep a
98
+ fallback for market closures.
96
99
 
97
100
  ## Versioning policy
98
101
 
@@ -115,6 +115,23 @@ config = FetcherConfig(timeout=60)
115
115
  stats = await get_trading_statistics("S50Z25", config=config)
116
116
  ```
117
117
 
118
+ ## Errors
119
+
120
+ | Situation | Raised | What to do |
121
+ |---|---|---|
122
+ | Unknown series symbol (TFEX answers HTTP 404) | `SeriesNotFoundError` (0.27.0) | fix the symbol; never retry |
123
+ | Any other non-2xx | `HTTPStatusError` (`.status_code`, `.url`) | 5xx/429 may be worth a later retry |
124
+ | Body is not a JSON object / invalid JSON | `ResponseParseError` | report it; do not retry in a loop |
125
+
126
+ `SeriesNotFoundError` is an `HTTPStatusError` **and** a `NotFoundError`, so `except NotFoundError`
127
+ (the library-wide "do not retry" catch) now covers an unknown TFEX series. Before 0.27.0 the same
128
+ answer was a plain `HTTPStatusError(404)` that `except NotFoundError` silently missed. Keying on
129
+ `exc.status_code == 404` works on every version. Import from `settfex.exceptions`, not from httpx:
130
+ settfex's `HTTPStatusError` has the same name as httpx's but is a different class.
131
+
132
+ The same applies to `get_underlying_price()`. The series *list* takes no symbol, so a 404 there
133
+ means a wrong route and stays an `HTTPStatusError`.
134
+
118
135
  ## Usage Examples
119
136
 
120
137
  ### Example 1: Basic Trading Statistics
@@ -255,15 +255,18 @@ await manager.ensure_initialized()
255
255
  ### Cache Location
256
256
 
257
257
  ```
258
- ~/.settfex/cache/
259
- ├── cache.db # SQLite index
260
- ├── 00/ # Data shards
261
- │ ├── 00.val
262
- │ ├── 01.val
263
- │ └── ...
264
- └── ...
258
+ ~/.settfex/cache/ # 0700
259
+ ├── sessions.sqlite3 # 0600 - one row per site/browser, JSON text (since 0.26.1)
260
+ ├── sessions.sqlite3-wal # SQLite write-ahead log
261
+ ├── sessions.sqlite3-shm
262
+ └── cache.db, 00/ ... # only if upgraded from <= 0.26.0: the old diskcache store,
263
+ # never opened again; safe to delete
265
264
  ```
266
265
 
266
+ Each row holds a site's cookies **with the domain, host-only flag, path, secure flag and expiry
267
+ they were issued for** (`cookie_jar`, since 0.26.3), plus the plain `cookies` name → value map that
268
+ 0.26.1/0.26.2 read.
269
+
267
270
  ### Directory Permissions
268
271
 
269
272
  The cache directory is created **`0700`** (owner only), and an existing `~/.settfex/cache` left
@@ -279,6 +282,16 @@ write access to this directory meant code execution in your process. The store i
279
282
  `sqlite3` holding JSON text: a row that is not a JSON object is a cache miss, never code. The old
280
283
  `cache.db` is never opened; delete it if you like. The session warms up once after the upgrade.
281
284
 
285
+ **Each cookie is restored with the domain it was issued for (since 0.26.3).** Until 0.26.3 the cache
286
+ kept only name → value and restored each cookie with no domain. curl_cffi binds such a cookie to the
287
+ host of the **first** request that carries it, so the first request after a restore decided where a
288
+ site's cookies went, even to another host. Each cookie now comes back with its own attributes
289
+ (a real SET warm-up yields `.set.or.th` for the Incapsula cookies and host-only `www.set.or.th` for
290
+ `charlot`), so it is sent to that domain and nowhere else. An entry without those attributes,
291
+ written by 0.26.2 or older, is treated as a miss: one anonymous warm-up, then the row is rewritten.
292
+ A cookie whose domain is not the site's own is refused the same way, so a planted row cannot steer a
293
+ site's cookies to another host.
294
+
282
295
  A directory **you** passed as `cache_dir` is treated differently: it is created `0700` if new, but
283
296
  if it already exists and is group/other-**writable**, settfex logs a warning and
284
297
  **leaves the mode alone**. A shared cache may be deliberate, and silently breaking that layout
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "settfex"
3
- version = "0.26.2"
3
+ version = "0.27.0"
4
4
  description = "Async Python library for fetching real-time and historical data from the Stock Exchange of Thailand (SET) and Thailand Futures Exchange (TFEX)"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -64,7 +64,7 @@ Usage:
64
64
  >>> asyncio.run(main())
65
65
  """
66
66
 
67
- __version__ = "0.26.2"
67
+ __version__ = "0.27.0"
68
68
  __author__ = "batt"
69
69
  __license__ = "MIT"
70
70
 
@@ -77,6 +77,7 @@ from settfex.exceptions import (
77
77
  InvalidLanguageError,
78
78
  InvalidSymbolError,
79
79
  NotFoundError,
80
+ SeriesNotFoundError,
80
81
  StaleDataError,
81
82
  SymbolNotFoundError,
82
83
  )
@@ -242,6 +243,7 @@ __all__ = [
242
243
  # Exceptions
243
244
  "FetchError",
244
245
  "NotFoundError",
246
+ "SeriesNotFoundError",
245
247
  "SymbolNotFoundError",
246
248
  "StaleDataError",
247
249
  "InvalidSymbolError",
@@ -28,6 +28,7 @@ __all__ = [
28
28
  "ParseError",
29
29
  "IncompleteListingError",
30
30
  "HTTPStatusError",
31
+ "SeriesNotFoundError",
31
32
  "UnexpectedPageError",
32
33
  "SoftNotFoundError",
33
34
  "CompanyNotFoundError",
@@ -256,6 +257,24 @@ class HTTPStatusError(FetchError):
256
257
  self.report_code = report_code
257
258
 
258
259
 
260
+ class SeriesNotFoundError(HTTPStatusError, NotFoundError):
261
+ """A TFEX per-series endpoint answered HTTP 404: the series symbol is unknown to TFEX.
262
+
263
+ Raised by the trading-statistics and underlying-price services (0.27.0). Until 0.27.0 the same
264
+ answer was a plain :class:`HTTPStatusError` with ``status_code=404``, while the SET stock
265
+ endpoints raise :class:`SymbolNotFoundError`, so ``except NotFoundError`` caught a bad stock
266
+ symbol but silently missed every bad TFEX series.
267
+
268
+ A **strict subclass of** :class:`HTTPStatusError`, keeping ``status_code``, ``url`` and
269
+ ``symbol``: every ``except HTTPStatusError`` / ``except FetchError`` written against 0.26.x
270
+ still catches it, so this is additive, not a change. The :class:`NotFoundError` marker adds
271
+ the "do not retry" catch. A caller keying on ``status_code == 404`` works on every version.
272
+
273
+ The series LIST endpoint does not raise this: it takes no symbol, so a 404 there means a wrong
274
+ route, not an unknown series, and stays an :class:`HTTPStatusError`.
275
+ """
276
+
277
+
259
278
  class UnexpectedPageError(FetchError):
260
279
  """The server answered with a page where a document (or data) was expected.
261
280
 
@@ -64,8 +64,9 @@ MAX_YEAR = 2100
64
64
  # * The endpoint DEGRADES UNDER POLLING. Success falls from ~100% cold to ~35% after ~50 requests
65
65
  # and ~12% after ~150, recovering only when left idle. Retrying a 401 therefore makes the next
66
66
  # attempt LESS likely to succeed, not more -- the ladder actively works against itself.
67
- # * Against the persistent 401 the endpoint has served since 2026-09-20 (issue #140) the ladder
68
- # buys nothing and costs ~128s per call at the default max_retries=3.
67
+ # * Against the run of current-year 401s from 2026-09-20 (issue #140; intermittent, not
68
+ # persistent, as a 30-minute poller's success on every logged day showed) the ladder bought
69
+ # nothing and cost ~128s per call at the default max_retries=3.
69
70
  #
70
71
  # 403 and 429 stay retryable: neither has been observed here, and both are ordinary transient
71
72
  # statuses elsewhere.
@@ -330,10 +331,12 @@ class HolidayService:
330
331
  # see the note on _RETRYABLE_STATUS for why retrying made things worse.
331
332
  error_msg += (
332
333
  " - the API returns 401 for years it does not serve (only the current year is"
333
- " available), and since 2026-09-20 it has answered 401 for the CURRENT year"
334
- " too, which is an upstream outage rather than a settfex defect (see"
335
- " https://github.com/lumduan/settfex/issues/140). Not retried: this endpoint"
336
- " degrades under polling, so a retry ladder lowers the chance of success"
334
+ " available) and, intermittently, for the CURRENT year too: an upstream"
335
+ " behaviour no settfex change can fix (see"
336
+ " https://github.com/lumduan/settfex/issues/140 - reported as persistent from"
337
+ " 2026-09-20, but a 30-minute poller still succeeded on every logged day)."
338
+ " Not retried: this endpoint degrades under polling, so a retry ladder lowers"
339
+ " the chance of success; try again later instead"
337
340
  )
338
341
  logger.error(error_msg)
339
342
  raise_for_status(response.status_code, error_msg, suggest=False)