settfex 0.26.3__tar.gz → 0.28.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.
- {settfex-0.26.3 → settfex-0.28.0}/.github/workflows/ci.yml +2 -2
- {settfex-0.26.3 → settfex-0.28.0}/.github/workflows/dependency-drift.yml +1 -1
- {settfex-0.26.3 → settfex-0.28.0}/.github/workflows/live-smoke.yml +1 -1
- {settfex-0.26.3 → settfex-0.28.0}/.github/workflows/pre-commit.yml +1 -1
- {settfex-0.26.3 → settfex-0.28.0}/.github/workflows/release.yml +2 -2
- {settfex-0.26.3 → settfex-0.28.0}/.github/workflows/security.yml +2 -2
- {settfex-0.26.3 → settfex-0.28.0}/AGENTS.md +27 -13
- {settfex-0.26.3 → settfex-0.28.0}/CHANGELOG.md +206 -0
- {settfex-0.26.3 → settfex-0.28.0}/CLAUDE.md +23 -4
- {settfex-0.26.3 → settfex-0.28.0}/PKG-INFO +9 -5
- {settfex-0.26.3 → settfex-0.28.0}/README.md +8 -4
- {settfex-0.26.3 → settfex-0.28.0}/docs/settfex/services/sec/financial_report.md +96 -8
- {settfex-0.26.3 → settfex-0.28.0}/docs/settfex/services/set/financial.md +37 -1
- {settfex-0.26.3 → settfex-0.28.0}/docs/settfex/services/tfex/trading_statistics.md +17 -0
- {settfex-0.26.3 → settfex-0.28.0}/pyproject.toml +1 -1
- {settfex-0.26.3 → settfex-0.28.0}/settfex/__init__.py +3 -1
- {settfex-0.26.3 → settfex-0.28.0}/settfex/exceptions.py +57 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/sec/download.py +92 -6
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/holiday.py +9 -6
- settfex-0.28.0/settfex/services/tfex/_series.py +34 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/tfex/trading_statistics.py +27 -4
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/tfex/underlying_price.py +18 -3
- {settfex-0.26.3 → settfex-0.28.0}/settfex/utils/data_fetcher.py +44 -3
- {settfex-0.26.3 → settfex-0.28.0}/settfex/utils/parsing.py +61 -2
- {settfex-0.26.3 → settfex-0.28.0}/tests/golden/api_surface.json +211 -1
- {settfex-0.26.3 → settfex-0.28.0}/tests/integration/test_live_endpoints.py +27 -1
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/README.md +1 -0
- settfex-0.28.0/tests/services/sec/fixtures_sec/idisc_akamai_interstitial.html +1 -0
- settfex-0.28.0/tests/services/sec/test_bot_challenge_and_redirects.py +243 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/set/test_holiday.py +3 -2
- settfex-0.28.0/tests/services/tfex/test_series_not_found.py +132 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/utils/test_session_manager.py +10 -2
- {settfex-0.26.3 → settfex-0.28.0}/uv.lock +466 -363
- {settfex-0.26.3 → settfex-0.28.0}/.editorconfig +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/.github/dependabot.yml +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/.github/instructions/core-architectrual-principles.instructions.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/.github/instructions/documentation-standards.instructions.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/.github/instructions/file-organization.instructions.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/.github/instructions/git-commit.instructions.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/.github/instructions/python-dependency-management.instructions.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/.github/prompts/Coding.prompt.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/.github/prompts/Git-Commit-Reviewer.prompt.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/.github/prompts/Prompt-Engineer.prompt.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/.github/prompts/Python-Architect.prompt.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/.gitignore +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/.pre-commit-config.yaml +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/.python-version +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/CODE_OF_CONDUCT.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/COMPREHENSIVE_AUDIT.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/CONTRIBUTING.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/LICENSE +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/RELEASING.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/SECURITY.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/docs/guide/PYTHON_LIBRARY_BEST_PRACTICES.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/docs/index.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/docs/settfex/services/sec/executive_trades.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/docs/settfex/services/set/API_PROTECTION_NOTE.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/docs/settfex/services/set/analyst_consensus.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/docs/settfex/services/set/board_of_director.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/docs/settfex/services/set/chart_quotation.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/docs/settfex/services/set/corporate_action.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/docs/settfex/services/set/dr_indicative_price.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/docs/settfex/services/set/earnings_call.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/docs/settfex/services/set/highlight_data.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/docs/settfex/services/set/holiday.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/docs/settfex/services/set/index.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/docs/settfex/services/set/info.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/docs/settfex/services/set/latest_historical_trading.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/docs/settfex/services/set/list.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/docs/settfex/services/set/news.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/docs/settfex/services/set/nvdr_holder.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/docs/settfex/services/set/price_performance.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/docs/settfex/services/set/profile_company.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/docs/settfex/services/set/profile_dr.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/docs/settfex/services/set/profile_stock.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/docs/settfex/services/set/shareholder.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/docs/settfex/services/set/trading_stat.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/docs/settfex/services/tfex/list.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/docs/settfex/services/thaibma/yield_curve.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/docs/settfex/utils/data_fetcher.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/docs/settfex/utils/session_caching.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/docs/solution/FINDINGS.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/docs/solution/Performance Boost Session Caching Implementation.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/docs/solution/SESSION_CACHE_SUMMARY.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/docs/solution/SOLUTION_100_PERCENT.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/README.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/sec/01_financial_report.ipynb +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/sec/02_executive_trades.ipynb +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/set/01_stock_list.ipynb +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/set/02_highlight_data.ipynb +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/set/03_stock_profile.ipynb +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/set/04_company_profile.ipynb +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/set/05_corporate_action.ipynb +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/set/06_shareholder.ipynb +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/set/07_nvdr_holder.ipynb +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/set/08_board_of_director.ipynb +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/set/09_trading_statistics.ipynb +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/set/10_price_performance.ipynb +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/set/11_financial.ipynb +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/set/12_earnings_call.ipynb +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/set/13_chart_quotation.ipynb +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/set/14_latest_historical_trading.ipynb +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/set/15_market_index.ipynb +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/set/16_news.ipynb +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/set/17_holiday.ipynb +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/set/18_dr_and_asset_type.ipynb +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/set/19_analyst_consensus.ipynb +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/set/20_stock_info.ipynb +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/set/README.md +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/set/cpall_balance_sheet.csv +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/set/market_dashboard_20251005_173221.csv +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/set/market_dashboard_20251005_210737.csv +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/set/market_dashboard_20251006_091440.csv +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/set/thailand_banking_stocks.csv +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/set/thailand_set_main_board.csv +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/set/thailand_stock_universe.csv +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/tfex/01_series_list.ipynb +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/tfex/02_trading_statistics.ipynb +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/tfex/03_underlying_price.ipynb +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/examples/thaibma/01_government_yield_curve.ipynb +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/deprecations.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/py.typed +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/__init__.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/sec/__init__.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/sec/company.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/sec/constants.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/sec/executive_trades.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/sec/financial_report.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/sec/sec.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/sec/utils.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/__init__.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/asset_type.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/constants.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/earnings_call.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/index/__init__.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/index/chart_quotation.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/index/composition.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/index/index.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/index/info.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/index/list.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/index/utils.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/list.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/news.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/stock/__init__.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/stock/analyst_consensus.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/stock/board_of_director.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/stock/chart_quotation.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/stock/corporate_action.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/stock/dr_indicative_price.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/stock/financial/__init__.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/stock/financial/financial.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/stock/highlight_data.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/stock/info.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/stock/latest_historical_trading.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/stock/nvdr_holder.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/stock/price_performance.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/stock/profile_company.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/stock/profile_dr.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/stock/profile_stock.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/stock/shareholder.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/stock/stock.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/stock/trading_stat.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/set/stock/utils.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/tfex/__init__.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/tfex/constants.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/tfex/list.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/thaibma/__init__.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/thaibma/availability.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/thaibma/constants.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/thaibma/history.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/thaibma/thaibma.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/thaibma/utils.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/services/thaibma/yield_curve.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/utils/__init__.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/utils/http.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/utils/logging.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/utils/session_cache.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/utils/session_manager.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/settfex/utils/youtube_transcript.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/__init__.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/conftest.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/golden/model_contract/analyst_consensus.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/golden/model_contract/dr_profile.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/golden/model_contract/earnings_call_item.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/golden/model_contract/highlight_data.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/golden/model_contract/holiday_calendar.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/golden/model_contract/index_list_response.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/golden/model_contract/news_search_response.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/golden/model_contract/sec_company_match.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/golden/model_contract/sec_executive_trade.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/golden/model_contract/sec_executive_trade_report.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/golden/model_contract/stock_info.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/golden/model_contract/stock_list_response.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/golden/model_contract/tfex_series_list_response.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/golden/model_contract/tfex_trading_statistics.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/golden/model_contract/tfex_underlying_price.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/golden/model_contract/yield_curve.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/integration/__init__.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/integration/conftest.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/__init__.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/__init__.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/derive_r59_fixtures.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/derive_th_fixtures.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/capital_indirection_en.html +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/en_mother_fs_h1_2025.html +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/en_ptt_56_1.html +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/en_ptt_56_2.html +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/en_ptt_fs_h1_2025.html +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/en_ptt_viewmore_56_2.html +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/idisc_505_error_page.html +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592000082610_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592000092610_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592000102610_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592000142610_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592000152610_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592000392610_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592000452610_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592000522610_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592000532609_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592000542609_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592001242610_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592001262610_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592001352609_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592001352610_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592001372609_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592001432610_en.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592001432610_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592002622609_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592002632609_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592002772609_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592002782609_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592002882609_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592002892609_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592003112609_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592003122609_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592003452609_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592003462609_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592003632609_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592003652609_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592004042609_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592004052609_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592004192609_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592004202609_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592004532609_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592004542609_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592004802609_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592004812609_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592004992609_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592005002609_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592005172609_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592005182609_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/detail_592005512609_th.json +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/en_default_20261007.html +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/th_capped_rcv_20261002.html +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/th_default_20261007.html +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/th_edge_rows.html +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/th_empty.html +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/th_kcg_txn_202609.html +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/th_sep_pairs.html +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/r59/th_spali_txn_202609.html +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/th_cpall_viewmore_56_1.html +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/th_mother_fs_h1_2025.html +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/th_ptt_56_1.html +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/th_ptt_56_2.html +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/fixtures_sec/th_ptt_fs_h1_2025.html +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/test_code_isolation.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/test_company.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/test_download.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/test_download_evidence.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/test_download_indirection.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/test_download_result.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/test_executive_trades.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/test_financial_report.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/test_financial_report_accounting.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/test_financial_report_th.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/test_listing_transport.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/test_sec.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/test_utils.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/sec/test_view_more_slugs.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/set/__init__.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/set/index/__init__.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/set/index/test_chart_quotation.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/set/index/test_composition.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/set/index/test_index.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/set/index/test_info.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/set/index/test_list.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/set/stock/__init__.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/set/stock/financial/__init__.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/set/stock/financial/test_financial.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/set/stock/test_analyst_consensus.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/set/stock/test_chart_quotation.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/set/stock/test_dr_indicative_price.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/set/stock/test_info.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/set/stock/test_latest_historical_trading.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/set/stock/test_profile_dr.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/set/test_asset_type.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/set/test_board_of_director.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/set/test_client.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/set/test_corporate_action.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/set/test_earnings_call.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/set/test_historical.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/set/test_list.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/set/test_listed_symbol.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/set/test_news.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/set/test_profile_company.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/set/test_realtime.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/set/test_shareholder.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/set/test_symbol_suggestion.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/test_fault_matrix.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/tfex/__init__.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/tfex/test_client.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/tfex/test_historical.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/tfex/test_list.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/tfex/test_realtime.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/tfex/test_trading_statistics.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/tfex/test_underlying_price.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/thaibma/__init__.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/thaibma/fixtures.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/thaibma/test_availability.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/thaibma/test_history.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/thaibma/test_thaibma.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/thaibma/test_utils.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/services/thaibma/test_yield_curve.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/test_deprecations.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/test_documented_exceptions.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/test_impersonate_target.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/test_model_contract.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/test_not_found_taxonomy.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/test_public_api_surface.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/test_readme_links.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/test_typing_surface.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/utils/__init__.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/utils/test_blocked_error.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/utils/test_data_fetcher.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/utils/test_formatting.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/utils/test_http.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/utils/test_logging.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/utils/test_logging_neighbourliness.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/utils/test_parsing.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/utils/test_session_cache.py +0 -0
- {settfex-0.26.3 → settfex-0.28.0}/tests/utils/test_validation.py +0 -0
- {settfex-0.26.3 → settfex-0.28.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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
@@ -329,6 +329,7 @@ being wrong, so none of them will announce itself.
|
|
|
329
329
|
| **`market_status` says `'Closed'` for every symbol after hours** — it is not a suspension flag | use `.is_suspended`, which reads the per-symbol sign |
|
|
330
330
|
| **A suspended symbol returns HTTP 200 with `last`/OHLC/volume all `null`** and an empty book | that is data, not an error; quote `.prior` as its last known price |
|
|
331
331
|
| **A market-wide sign scan via index compositions sees COMMON STOCKS only** (929 of 3,954 symbols) | suspended warrants/DWs/DRs are invisible to it — check those with `get_stock_info()` |
|
|
332
|
+
| **A SET financial statement's `download_url` is the same zip as SEC's `Download?FILEID=`** (identical bytes), but the SET API lists only **five periods** | for older periods or other filing types use `get_sec_documents()`. While the SEC listing raises `BotChallengeError`, the SET link still serves the latest statements |
|
|
332
333
|
|
|
333
334
|
---
|
|
334
335
|
|
|
@@ -339,12 +340,14 @@ Everything is importable from one place:
|
|
|
339
340
|
```python
|
|
340
341
|
from settfex.exceptions import (
|
|
341
342
|
# --- the cross-cutting catch: a name that does not exist (0.25.0) ---
|
|
342
|
-
NotFoundError, # base of
|
|
343
|
+
NotFoundError, # base of Symbol-, Series- AND CompanyNotFoundError; never retry
|
|
343
344
|
# --- the FETCH family: `except FetchError` catches all of these ---
|
|
344
345
|
FetchError, # HTTP/transport failure; carries .status_code and .symbol
|
|
345
346
|
HTTPStatusError, # a non-2xx, with .url and .report_code as data
|
|
347
|
+
SeriesNotFoundError, # TFEX 404: unknown series (0.27.0); an HTTPStatusError, never retry
|
|
346
348
|
UnexpectedPageError, # a PAGE where a document was expected (0.26.0); carries the answer
|
|
347
349
|
SoftNotFoundError, # its "file not found" page — can be FALSE; NOT a NotFoundError
|
|
350
|
+
OffHostRedirectError, # an old-format download redirected to ANOTHER host (0.28.0); not followed
|
|
348
351
|
SymbolNotFoundError, # SET 404, or an unlisted analyst-consensus symbol; .suggestion
|
|
349
352
|
StaleDataError, # ThaiBMA rolled back and you asked it to raise
|
|
350
353
|
ParseError, # a response arrived intact and could not be mapped
|
|
@@ -359,6 +362,7 @@ from settfex.exceptions import (
|
|
|
359
362
|
from settfex.utils.parsing import (
|
|
360
363
|
ResponseParseError, # also a ParseError since 0.24.0
|
|
361
364
|
BlockedError, # a WAF block page (0.25.0): stop, never retry; an UnexpectedPageError
|
|
365
|
+
BotChallengeError, # a bot-management CHALLENGE page (Akamai, 0.28.0): a BlockedError; never solved
|
|
362
366
|
)
|
|
363
367
|
```
|
|
364
368
|
|
|
@@ -367,11 +371,12 @@ never is.** An input error means the request *succeeded* and your argument was w
|
|
|
367
371
|
loop on one spins forever. `InvalidSymbolError`, `InvalidLanguageError` and `InvalidDateError` are
|
|
368
372
|
raised before any network call at all.
|
|
369
373
|
|
|
370
|
-
⚠️
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
374
|
+
⚠️ Several "not found" types still coexist. A SET 404 is a `SymbolNotFoundError` (a `FetchError`);
|
|
375
|
+
an unknown TFEX series is a `SeriesNotFoundError` (an `HTTPStatusError`, since 0.27.0; before that
|
|
376
|
+
a plain `HTTPStatusError(404)` that `except NotFoundError` missed); the SEC equivalent is a
|
|
377
|
+
`CompanyNotFoundError` (a `ValueError`). All of them are also a **`NotFoundError`**. Catch that
|
|
378
|
+
one, and catch it **before** `FetchError`: a `SymbolNotFoundError` or `SeriesNotFoundError` is a
|
|
379
|
+
`FetchError` too, and a retry handler would otherwise retry a typo forever:
|
|
375
380
|
|
|
376
381
|
```python
|
|
377
382
|
try:
|
|
@@ -408,15 +413,24 @@ text:
|
|
|
408
413
|
|
|
409
414
|
---
|
|
410
415
|
|
|
411
|
-
### ⚠️ `get_holidays()`
|
|
416
|
+
### ⚠️ `get_holidays()` fails intermittently upstream
|
|
412
417
|
|
|
413
|
-
The SET holiday endpoint answers **HTTP 401 for the current year**,
|
|
414
|
-
serves
|
|
415
|
-
|
|
418
|
+
The SET holiday endpoint sometimes answers **HTTP 401 for the current year**, the only year it
|
|
419
|
+
serves. From 2026-09-20 settfex's own probes saw it repeatedly and reported it as a persistent
|
|
420
|
+
outage (issue #140). But a downstream poller running every 30 minutes succeeded at least once on
|
|
421
|
+
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
|
|
422
|
+
holidays). So treat it as **available but unreliable**: a 401 can be an intermittent failure or an
|
|
423
|
+
unserved year, and the response looks the same in both cases.
|
|
416
424
|
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
425
|
+
How unreliable, measured over 72 h (2026-11-04 → 11-07, one attempt every 30 minutes): **13 of 145
|
|
426
|
+
calls succeeded (9%)**, but at least twice on every day, with a longest gap of 17 h. So **one call
|
|
427
|
+
usually fails**. Poll on a schedule and keep the last good calendar; never treat a single 401 as
|
|
428
|
+
"no holidays" or as an answer.
|
|
429
|
+
|
|
430
|
+
Since 0.24.1 a 401 fails **immediately** instead of retrying for ~128 s. Do not retry it in a
|
|
431
|
+
loop (the endpoint degrades under polling), and do not report a 401 as a library bug. Keep another
|
|
432
|
+
source for market closures if trading-day logic depends on it; `is_holiday()` never covered
|
|
433
|
+
weekends anyway.
|
|
420
434
|
|
|
421
435
|
## Run it, don't hand it over
|
|
422
436
|
|
|
@@ -5,8 +5,214 @@ 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.28.0] - 2026-11-19
|
|
83
|
+
|
|
84
|
+
Two SEC answers a caller could not tell apart, from a downstream archive's reports: a bot-management challenge, and an off-host redirect. **Additive:** nothing a 0.27.x caller catches stops catching. Built from that archive's captured page and recorded bytes. One live listing call on 2026-11-19 09:05 ICT confirmed the normal path is unaffected (no challenge was active at that moment).
|
|
85
|
+
|
|
86
|
+
### Added
|
|
87
|
+
|
|
88
|
+
- **`BotChallengeError`** (`settfex.utils.parsing`), a `BlockedError` subclass for a
|
|
89
|
+
bot-management **challenge** page. Since 2026-11-11, `market.sec.or.th`'s iDisc listing GET
|
|
90
|
+
**sometimes** answers a client that does not run JavaScript with **HTTP 200** `text/html`:
|
|
91
|
+
Akamai Bot Manager's interstitial. It is a `<meta refresh>` carrying a `bm-verify` token, plus a
|
|
92
|
+
script that POSTs the token with a proof of work to `/_sec/verify`, behind a SEC-branded loading
|
|
93
|
+
animation.
|
|
94
|
+
- **When it started:** with an SEC infrastructure change on the night of 2026-11-10/11, per a
|
|
95
|
+
downstream archive's response headers. The listing's F5 cookies (`TS01…`) were replaced by
|
|
96
|
+
Akamai's `ak_bmsc`, and HTTP/3 `alt-svc`, HSTS and a CSP appeared.
|
|
97
|
+
- **It is not a maintenance page:** a browser on the same IP saw the normal listing on 11-17 and
|
|
98
|
+
11-19. SEC's maintenance answers in that period came from `capital.sec.or.th` (via
|
|
99
|
+
`maintenance.sec.or.th`, or an Azure fallback), a different host.
|
|
100
|
+
- **It is intermittent:** on 2026-11-19 a settfex listing passed at 09:05 ICT, and three bare
|
|
101
|
+
GETs from the same IP were challenged at 09:10-09:11.
|
|
102
|
+
- **Keeping the `ak_bmsc` cookie does not clear it** (tested, two GETs on one session): it waits
|
|
103
|
+
for the script's proof of work. That is why SET-style cookie warming cannot help here. Until now the listing surfaced it as
|
|
104
|
+
`FetchError("SEC search page returned no __VIEWSTATE token — the page structure may have
|
|
105
|
+
changed…")` with no status, so a challenge was indistinguishable from a site redesign. A download
|
|
106
|
+
with no `Content-Type` would have accepted it as the document.
|
|
107
|
+
- It is recognised (both `bm-verify` and `/_sec/verify` in a body of at most 8 KB) and **never
|
|
108
|
+
solved**: the refresh is not followed, the script is not run, the token is not sent.
|
|
109
|
+
- The fetcher raises it for any 2xx (listings, ViewMore, downloads, Form 59), and the download
|
|
110
|
+
path for any status. Never retried.
|
|
111
|
+
- Evidence: status, URL, headers without `Set-Cookie` (`ak_bmsc`), the body with its
|
|
112
|
+
`bm-verify` token screened, and the elapsed time.
|
|
113
|
+
- Being a `BlockedError` (and so an `UnexpectedPageError`, `ParseError` and `FetchError`), every
|
|
114
|
+
existing "stop and back off" handler and the batch stops catch it unchanged.
|
|
115
|
+
- The test fixture is the downstream archive's real capture, copied verbatim.
|
|
116
|
+
- **`OffHostRedirectError`** (`settfex.exceptions`), an `UnexpectedPageError`. The old-format
|
|
117
|
+
download's `capital.sec.or.th/tmp/<id>.zip` fetch followed redirects to any host. A downstream
|
|
118
|
+
archive's raw-byte capture (2026-10-09) showed BigIP answering it, for some filings, with an
|
|
119
|
+
HTTP/1.0 302 to an Azure host serving SEC's maintenance page. libcurl followed it, the Azure host
|
|
120
|
+
answered 505, and the error said `Failed to download http://capital.sec.or.th/tmp/…: HTTP 505`,
|
|
121
|
+
a status from a host the message never named.
|
|
122
|
+
- Redirects are now followed only while they stay on the host (at most 5); an off-host one raises
|
|
123
|
+
this error before any request leaves the host, carrying `location` and `target_host`. The same
|
|
124
|
+
rule the JavaScript indirection already applied.
|
|
125
|
+
- **`AsyncDataFetcher.fetch(..., follow_redirects=True)`**: `False` returns a 3xx as the response.
|
|
126
|
+
It requires `use_session=False`; a persistent session raises `NotImplementedError`.
|
|
127
|
+
|
|
128
|
+
### Changed
|
|
129
|
+
|
|
130
|
+
- **A download error names the host that answered** when a followed redirect left the requested
|
|
131
|
+
one (`Failed to download <url>: HTTP 505 (answered by <host>)`). When the hosts match, the message
|
|
132
|
+
is exactly as before.
|
|
133
|
+
|
|
134
|
+
### Documentation
|
|
135
|
+
|
|
136
|
+
- **Where to download a financial statement: SEC or SET's link, and why settfex uses SEC.**
|
|
137
|
+
Verified live 2026-11-19 (`docs/settfex/services/sec/financial_report.md`, and the
|
|
138
|
+
`download_url` section of `docs/settfex/services/set/financial.md`).
|
|
139
|
+
- **The SET factsheet's `download_url` is the same zip.** It is on `weblink.set.or.th`, at the
|
|
140
|
+
same `dat/news/…` path as SEC's `Download?FILEID=`, with **identical bytes** (CPALL Q3/2569,
|
|
141
|
+
sha256 `d61e0115…`). It is also the link behind the "งบการเงินล่าสุด" (latest financial
|
|
142
|
+
statements) button on SET's quote page.
|
|
143
|
+
- **Why settfex downloads from SEC:**
|
|
144
|
+
- full history (SET's API lists five periods);
|
|
145
|
+
- five filing categories (SET: statements only);
|
|
146
|
+
- the completeness checks;
|
|
147
|
+
- it is the record SET mirrors.
|
|
148
|
+
- **When SET's link is the better route:** the latest statements while the SEC listing is
|
|
149
|
+
challenged, because the SET host is not behind Akamai.
|
|
150
|
+
- **SET's copy is not earlier:** the SET news item came about 3.5 h after the file's stamp, and
|
|
151
|
+
the factsheet lags further.
|
|
152
|
+
- The `9M` quarter code is now documented.
|
|
153
|
+
- **How unreliable `get_holidays()` is, measured.** A downstream consumer polled it once every
|
|
154
|
+
30 minutes for 72 h on 0.26.3 (2026-11-04 19:20 → 11-07 19:33 ICT): **13 of 145 calls succeeded
|
|
155
|
+
(9.0%)**, every typed failure was a 401, at least two calls succeeded on every day, and the
|
|
156
|
+
longest gap was 17 h. AGENTS.md, README and the CLAUDE.md gotcha now say that one call usually
|
|
157
|
+
fails, and that callers should poll on a schedule and keep the last good calendar. 401 stays
|
|
158
|
+
un-retried: a retry would multiply load on an endpoint that degrades under polling, while daily
|
|
159
|
+
freshness already holds without one.
|
|
160
|
+
|
|
161
|
+
## [0.27.0] - 2026-11-04
|
|
162
|
+
|
|
163
|
+
An unknown TFEX series gets its own "not found" error, and the holiday docs stop calling a
|
|
164
|
+
working endpoint dead. **Additive:** nothing a 0.26.x caller catches stops catching.
|
|
165
|
+
|
|
166
|
+
### Added
|
|
167
|
+
|
|
168
|
+
- **`SeriesNotFoundError`** (`settfex.exceptions`), raised by `get_trading_statistics()` and
|
|
169
|
+
`get_underlying_price()` (and their service and `_raw` methods) when TFEX answers **HTTP 404**,
|
|
170
|
+
i.e. the series symbol is unknown. Live-probed 2026-11-03: `ZZZZ99` answers 404 on both
|
|
171
|
+
endpoints. Until now that reached callers as a plain `HTTPStatusError(404)`, while SET stock
|
|
172
|
+
endpoints raise `SymbolNotFoundError`. So `except NotFoundError`, the library-wide "do not
|
|
173
|
+
retry" catch, caught a bad stock symbol and silently missed every bad TFEX series. A downstream
|
|
174
|
+
consumer nearly shipped exactly that catch.
|
|
175
|
+
- It is `SeriesNotFoundError(HTTPStatusError, NotFoundError)`: a **strict subclass** of what was
|
|
176
|
+
raised before, keeping `status_code`, `url` and `symbol`. So every `except HTTPStatusError` /
|
|
177
|
+
`except FetchError` still catches it. Additive under the deprecation policy, hence a minor
|
|
178
|
+
release and no warning period.
|
|
179
|
+
- Keying on `exc.status_code == 404` works on every version.
|
|
180
|
+
- Only a 404 is converted; every other status stays a plain `HTTPStatusError`, so a 503 is never
|
|
181
|
+
mistaken for "does not exist". The series **list** takes no symbol, so its 404 means a wrong
|
|
182
|
+
route and is unchanged.
|
|
183
|
+
- ⚠️ settfex's `HTTPStatusError` has the **same name** as httpx's and is a different class; import
|
|
184
|
+
it from `settfex.exceptions`. A downstream consumer's `except httpx.HTTPStatusError` had never
|
|
185
|
+
fired.
|
|
186
|
+
|
|
187
|
+
### Fixed
|
|
188
|
+
|
|
189
|
+
- **A test fixture that expired with the cookie it copied** (`tests/utils/test_session_manager.py`,
|
|
190
|
+
test-only). 0.26.3's cookie tests used the absolute expiry timestamps of a live 2026-11-02 jar,
|
|
191
|
+
and `charlot`'s (a ~1-day cookie) passed at 2026-11-03 20:42 ICT. An expired cookie is dropped
|
|
192
|
+
from the jar, so the leak test failed on main the next day with no code change. Expiries are now
|
|
193
|
+
relative to the test's own clock, with the live lifetimes kept (~1 day, ~1 year, session). The
|
|
194
|
+
library was never affected.
|
|
195
|
+
|
|
196
|
+
### Changed
|
|
197
|
+
|
|
198
|
+
- **`get_holidays()`'s 401 message no longer says the endpoint is down.** It said that since
|
|
199
|
+
2026-09-20 the endpoint "has answered 401 for the CURRENT year", and README and AGENTS.md said
|
|
200
|
+
the call "cannot succeed". Both claims came from settfex's own probes (#140, closed as
|
|
201
|
+
persistent). But a downstream consumer's poller, running every 30 minutes, banked at least one
|
|
202
|
+
successful response on every logged day from 2026-09-15 to 2026-11-02 (32 dates; first reported
|
|
203
|
+
as 36, recounted), and three live calls on 2026-11-03 (on 0.15.1 and 0.26.3) all returned 2026's
|
|
204
|
+
20 holidays. The current-year 401 is **intermittent, not persistent**. The message now says so,
|
|
205
|
+
and says to retry later rather than in a loop: the endpoint degrades under polling, so a 401 is
|
|
206
|
+
still not retried internally.
|
|
207
|
+
|
|
208
|
+
### Documentation
|
|
209
|
+
|
|
210
|
+
- **"Upgrading from 0.3.x, 0.15.x or 0.17.x"** at the top of this file. It collects everything
|
|
211
|
+
between those lines and the latest release that can change what calling code sees. Built from
|
|
212
|
+
a mechanical diff of the public API (functions, parameters, model fields and exception classes,
|
|
213
|
+
with annotation-only changes ignored) and checked against four downstream consumers.
|
|
214
|
+
- An **Errors** table in `docs/settfex/services/tfex/trading_statistics.md`.
|
|
215
|
+
|
|
10
216
|
## [0.26.3] - 2026-11-02
|
|
11
217
|
|
|
12
218
|
Cookie hardening for the session cache. No API change; one extra warm-up per site after upgrading.
|
|
@@ -108,7 +108,10 @@ evidence from that sweep was unusable, and the host stayed hostile long after th
|
|
|
108
108
|
`fetch_curves` and history) stop sending. The SEC download path also recognises it under a
|
|
109
109
|
**non-2xx** status (0.26.0), and it is an `UnexpectedPageError` carrying the answer. It subclasses `ResponseParseError`, so every older
|
|
110
110
|
handler still catches it — which also makes it a `ValueError`: catch `BlockedError` first. Only
|
|
111
|
-
the SEC page is recognised; no SET/Incapsula block page has ever been captured.
|
|
111
|
+
the SEC page is recognised; no SET/Incapsula block page has ever been captured. **Since 0.28.0
|
|
112
|
+
Akamai Bot Manager's interstitial challenge is recognised too** (`BotChallengeError`, a
|
|
113
|
+
`BlockedError`: needs both `bm-verify` and `/_sec/verify` in a small body). It has answered SEC's
|
|
114
|
+
iDisc listing GET nightly since 2026-11-11 (HTTP 200, `text/html`). settfex never solves it. Before 0.25.0 a
|
|
112
115
|
download **saved the block page as the filing** (it has no Content-Type). When one fires in the
|
|
113
116
|
wild, `exc.body` (support ID screened) is the byte-exact fixture the synthetic test page is
|
|
114
117
|
waiting to be replaced by.
|
|
@@ -398,7 +401,20 @@ dependency refresh; the enforcement tests it references live in `tests/`.)
|
|
|
398
401
|
breaks settfex (justify either in `CHANGELOG.md`). Upgrades move `uv.lock`, not the floors.
|
|
399
402
|
- **Cadence & detection:** Dependabot proposes bumps weekly; the `dependency-drift.yml`
|
|
400
403
|
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`.
|
|
404
|
+
in CI fails any commit whose lock is stale vs `pyproject.toml`. **Dependabot alerts and
|
|
405
|
+
security updates are ON (since 2026-11-03, operator-approved).** Before that only version
|
|
406
|
+
updates ran, and advisories surfaced only through pip-audit. The dependency graph reads the
|
|
407
|
+
whole `uv.lock`, extras included (190 packages, tornado among them), so an alert can fire for a
|
|
408
|
+
package only the `examples` extra pulls in. Security-update PRs arrive outside the Monday batch.
|
|
409
|
+
- **Merging several Dependabot lock PRs:** they merge as TEXT without conflicting (each makes the
|
|
410
|
+
same header edit) and Dependabot never rebases after a sibling lands, so the combined
|
|
411
|
+
`uv.lock` on main is a state no single PR's CI tested. Merge them all into a temporary branch
|
|
412
|
+
first, run the full gates plus `pip-audit` over every extra (and smoke-test the `examples`
|
|
413
|
+
extra, which CI never installs), then merge on GitHub in the same order and confirm main's
|
|
414
|
+
`uv.lock` blob equals the tested one (`git rev-parse <ref>:uv.lock`). Ask Dependabot to rebase
|
|
415
|
+
(`@dependabot rebase`) any PR whose base predates a lock change. Dependabot's uv also rewrites
|
|
416
|
+
the lock header from `revision = 3` to `5`; uv 0.12.17 reads both. (Done this way for
|
|
417
|
+
#160/#162/#169-#172 on 2026-11-03; learned from the tvkit repo.)
|
|
402
418
|
- **Upgrade protocol:** one package per commit — `uv lock --upgrade-package <name>==<target>`,
|
|
403
419
|
then the full gates (`pytest`, `ruff check`, `ruff format --check`, `mypy settfex/`); the lock
|
|
404
420
|
diff must move only the named package + its dependency closure, enumerated in the commit body.
|
|
@@ -509,7 +525,7 @@ See [`CHANGELOG.md`](CHANGELOG.md) for the full, versioned release history — t
|
|
|
509
525
|
- **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
526
|
- **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
527
|
- **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
|
|
528
|
+
- **`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. Measured SINCE, by the same consumer with failures logged at INFO: measured 2026-11-04 19:20 → 2026-11-07 19:33 ICT on 0.26.3, one attempt per 30-minute poll: 13 of 145 attempts succeeded (9.0%), every typed failure was 401, at least 2 successes on every day, longest gap 17 h — so a single call succeeds about 1 time in 11, and only repeated polling makes the calendar reliable. Do NOT bring back a 401 retry on this alone: it multiplies load on an endpoint that degrades under polling, and daily freshness already holds (operator-facing recommendation, 2026-11-07). 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
529
|
- **`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
530
|
- **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
531
|
- **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 +538,7 @@ See [`CHANGELOG.md`](CHANGELOG.md) for the full, versioned release history — t
|
|
|
522
538
|
- **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
539
|
- **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
540
|
- **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).
|
|
541
|
+
- **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
542
|
- **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
543
|
- **`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
544
|
- **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.
|
|
@@ -551,11 +568,13 @@ See [`CHANGELOG.md`](CHANGELOG.md) for the full, versioned release history — t
|
|
|
551
568
|
- **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
569
|
- **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`.
|
|
553
570
|
- **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.
|
|
571
|
+
- **SEC's iDisc listing sits behind Akamai Bot Manager since 2026-11-10/11 — `BotChallengeError` (0.28.0), and cookie warming does NOT help:** that night SEC's infrastructure changed (a downstream archive's response headers: the listing's F5 `TS01…` cookies became Akamai's `ak_bmsc`, and HTTP/3 `alt-svc`, HSTS and a CSP appeared). Since then the listing GET **sometimes** answers a client that runs no JavaScript with an HTTP 200 interstitial (`bm-verify` + `/_sec/verify` proof-of-work POST, SEC-branded loader iframe `/interestial-challenge`). **Not maintenance:** the operator's browser on the same IP saw the normal listing on 11-17 and 11-19, while SEC's real maintenance answers came from `capital.sec.or.th` (`maintenance.sec.or.th` on 11-10 from 22:24, an Azure fallback all night 11-18). **Intermittent:** on 11-19 a settfex listing passed at 09:05, and three bare GETs were challenged at 09:10-09:11. **Tested and ruled out: keeping the `ak_bmsc` cookie** (one session, two GETs, 6 s apart, both challenged). Akamai waits for the script's proof of work. That is why the SET approach (Incapsula issues a valid cookie on a plain visit) cannot carry over. ⚠️ **Do not make settfex solve the challenge** (run the JS, send the token, drive a headless browser). That circumvents a bot-detection control; the library recognises it and stops. A headless Chromium with a fresh profile drew a 403 "Block Response" page (Akamai reference-format Support ID) at 08:40 on 11-19.
|
|
572
|
+
- **SET's financial-statement `download_url` is the SAME FILE as SEC's `Download?FILEID=` — and settfex downloads from SEC on purpose:** `weblink.set.or.th/dat/news/<YYYYMM>/<name>.zip` and `market.sec.or.th/public/idisc/Download?FILEID=dat/news/<YYYYMM>/<name>.zip` returned identical bytes (CPALL Q3/2569 Thai, sha256 `d61e0115…`, 665,602 B, 2026-11-19). It is also the link behind the "งบการเงินล่าสุด" (latest financial statements) button on SET's quote page, rendered server-side. One zip per language (`…T`/`…E`, different files). Why SEC stays the document source: SET's factsheet lists **five periods** (SEC: years), statements only (SEC: five categories), and no completeness accounting. Why SET's link still matters: neither it nor `weblink` is behind the Akamai challenge, so it is the fallback for the latest statements. It is **not earlier**: CPALL's file is stamped 13:28, SET's news item linking it came at 17:00, and `weblink`'s `Last-Modified` is 01:00 the next day. A downstream consumer measured the factsheet at a median of about 12-36 h after the SEC stamp (99/99 later). Do not add a SET downloader without a decision; the docs show the stateless fetcher. The quarter code `9M` ("ไตรมาส 3", quarter 3) exists alongside `6M`/`Q9`.
|
|
554
573
|
- **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.
|
|
555
574
|
- **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.
|
|
556
575
|
- **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.**
|
|
557
576
|
- **~~`fs-r561` is an UNMAPPED ViewMore slug~~ — CLOSED in 0.22.2, and `fs-r562` with it:** `_CATEGORY_FOR_VIEWMORE_SLUG` used to map only `fs-norm`/`fs-kf`/`fs-mda`, the three sections one `FS` search returns, so a **56-1 or 56-2** section over the site's ~10-row inline cap truncated **even with `follow_view_more=True`**. 0.22.0's notes predicted it and said the shortfall WARNING would surface it — it did, reported by a downstream consumer reading `completeness()`. Both slugs were **live-probed, never guessed** (2026-09-20, CPALL/PTT/SCB × th/en), and the scale was larger than first reported: over a 2000-2026 window CPALL th 56-1 served **11 of 23**, PTT th 56-1 **11 of 25**, PTT 56-2 **10 of 15 in BOTH languages** — so it was never a Thai-only gap. Now 23/23, 25/25, 15/15, 15/15. ⚠️ **The `fs-` prefix is the site's own and is NOT a category hint** — `fs-r561` is served by the *56-1* search, not the FS one; a mapping keyed on the prefix would be wrong. Two surfaces state this fact: `_CATEGORY_FOR_VIEWMORE_SLUG` (used) and the public `SEC_VIEWMORE_SLUGS` in `constants.py` (**used nowhere**, so nothing would notice it going stale) — a test pins them equal.
|
|
558
|
-
- **SEC's old-format filings are on a FIFTH host and behind a JavaScript indirection (issue #133):** `capital.sec.or.th/…/get_zip_all_public_page.php` carries pre-2014 `.DOC`/`.XLS` filings. The URL answers **HTTP 200 with a 2 KB HTML page whose entire body is `document.location = '/tmp/<id>.zip'`** — so recognising the link is necessary but not sufficient, and `download()` resolves the redirect at download time (one extra request). Three properties the code depends on: the target is **minted per request** (`XP`/`sD`/`V1` for the same filing across three captures), so `file_url` stays the stable indirection URL and the `/tmp/…` one is never stored; it is **per-language** (the Thai request mints a different archive, so `lang` is part of the `capfin:<comp_id>-<year>-<period>-<lang>` id); and `comp_id` is a **different id space from `set_id`** in the same query — they are not interchangeable. The redirect pattern accepts an absolute URL on purpose, so the same-host check is live rather than dead code.
|
|
577
|
+
- **SEC's old-format filings are on a FIFTH host and behind a JavaScript indirection (issue #133):** `capital.sec.or.th/…/get_zip_all_public_page.php` carries pre-2014 `.DOC`/`.XLS` filings. The URL answers **HTTP 200 with a 2 KB HTML page whose entire body is `document.location = '/tmp/<id>.zip'`** — so recognising the link is necessary but not sufficient, and `download()` resolves the redirect at download time (one extra request). Three properties the code depends on: the target is **minted per request** (`XP`/`sD`/`V1` for the same filing across three captures), so `file_url` stays the stable indirection URL and the `/tmp/…` one is never stored; it is **per-language** (the Thai request mints a different archive, so `lang` is part of the `capfin:<comp_id>-<year>-<period>-<lang>` id); and `comp_id` is a **different id space from `set_id`** in the same query — they are not interchangeable. The redirect pattern accepts an absolute URL on purpose, so the same-host check is live rather than dead code. ⚠️ **The `/tmp/<id>.zip` fetch itself must not leave the host either (0.28.0):** for some filings BigIP answers it with an HTTP/1.0 302 to an Azure fallback host serving SEC's maintenance page, which libcurl followed (as `GET / HTTP/1.0`, so Azure answered 505) and the error then named capital's host (a downstream archive's raw-byte capture, 2026-10-09). `_fetch_on_host` now fetches with `follow_redirects=False`, follows on-host redirects only, and raises `OffHostRedirectError` before any request leaves the host.
|
|
559
578
|
- **These old-format zips are MEMBER-STABLE, not byte-stable — do not key an archive on the container hash:** re-minting the same filing produced a different container sha256 while every member payload stayed byte-identical. Exactly **12 bytes of 334,498** differ, in four 3-byte runs, one per member: the Info-ZIP extended-timestamp (`UT`) extra field, i.e. the pack time. **Judge integrity per member.** A consumer that hashes the container will see a legitimate re-fetch as a new — or corrupted — object. (Also observed: one sample's embedded pack time *predated* the request that minted it, suggesting the server sometimes hands back a previously generated archive. INFERRED from two samples.)
|
|
560
579
|
- **~~`DownloadResult` loses `.failed` the moment you derive a new list~~ — CLOSED in 0.24.0 (issue #134), and the fix has one silent cost:** `.failed`/`.requested`/`.is_complete` were instance attributes on a `list` subclass, so slicing, `sorted()`, `list()`, concatenation and comprehensions all returned a plain `list` without them — 6 of 7 ordinary operations. Both containers are **Pydantic models** now, so the report is a *field*: it survives `model_dump()`, JSON and every boundary an agent or a pipeline crosses, which is the real reason a model was chosen (function-calling results are JSON, so an unserialized signal does not exist at the tool boundary). `is_complete` is a **computed field** for the same reason. ⚠️ **`isinstance(x, list)` is now `False`, and that is the one break that fails *silently*** — it takes the other branch rather than raising. Everything else is kept: `len()`, `bool()`, iteration, integer indexing, `in`, and **slicing, which returns a model**. `sorted()`/`list()` still yield plain lists because iteration is kept — sort `docs.documents` / `files.files`. `dict(model)` now raises; use `model_dump()`.
|
|
561
580
|
- **One failing report code no longer discards the others — and `has_losses` is now the only reliable "was it complete?" check:** `fetch_documents` collapses the requested categories to up to three `ddlReportType` codes run concurrently; the gather had no `return_exceptions=True`, so the first exception propagated before the collecting line ran and a total loss in `R562` threw away the `FS` documents that had parsed fine (issue #132). Now: **partial loss reports, total loss raises** — one code failing keeps its siblings' documents and records a `CodeFailure` on `accounting.failed_codes`; every code failing re-raises the first cause with its type and traceback intact. ⚠️ **Anything that is not a `FetchError` propagates untouched** — a settfex bug must not be laundered into an accounting row, where it would be buried in a field most callers never read. ⚠️ **Deliberately NOT an `ExceptionGroup`** despite the 3.11+ floor: `except FetchError` does not catch one, so it would silently break every existing handler. When every code fails, the other causes ride along as **PEP 678 notes** (`exc.add_note`) on the raised one — otherwise re-raising a single exception would quietly drop them, breaking the rule that a caller can always tell which code failed and why. **"First" means first in report-code order, not first to fail in time** (`gather` returns positionally), so the raised cause is deterministic across runs; a test pins that by making the last code fail instantly while the first yields 20 times. ⚠️ **Upgrade trap:** a `try/except FetchError` that treated "no exception" as "complete" now sees a partial result as a whole one — check `has_losses` / `failed_codes`. The same `return_exceptions` treatment was applied to the ViewMore gather, so a transport error there costs one section's completeness rather than the call.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: settfex
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.28.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,14 @@ 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()`
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
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). Over a measured 72 h
|
|
143
|
+
(2026-11-04 → 11-07) about 9% of single calls succeeded, at least twice a day. Since
|
|
144
|
+
0.24.1 a 401 fails immediately rather than retrying for ~128 s: try again later, and keep a
|
|
145
|
+
fallback for market closures.
|
|
142
146
|
|
|
143
147
|
## Versioning policy
|
|
144
148
|
|
|
@@ -89,10 +89,14 @@ 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()`
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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). Over a measured 72 h
|
|
97
|
+
(2026-11-04 → 11-07) about 9% of single calls succeeded, at least twice a day. Since
|
|
98
|
+
0.24.1 a 401 fails immediately rather than retrying for ~128 s: try again later, and keep a
|
|
99
|
+
fallback for market closures.
|
|
96
100
|
|
|
97
101
|
## Versioning policy
|
|
98
102
|
|