settfex 0.26.1__tar.gz → 0.26.2__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.1 → settfex-0.26.2}/.github/workflows/security.yml +6 -1
- {settfex-0.26.1 → settfex-0.26.2}/CHANGELOG.md +36 -0
- {settfex-0.26.1 → settfex-0.26.2}/PKG-INFO +1 -1
- {settfex-0.26.1 → settfex-0.26.2}/pyproject.toml +1 -1
- {settfex-0.26.1 → settfex-0.26.2}/settfex/__init__.py +1 -1
- {settfex-0.26.1 → settfex-0.26.2}/settfex/utils/data_fetcher.py +5 -1
- {settfex-0.26.1 → settfex-0.26.2}/settfex/utils/logging.py +7 -2
- {settfex-0.26.1 → settfex-0.26.2}/tests/utils/test_data_fetcher.py +33 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/utils/test_logging_neighbourliness.py +43 -0
- {settfex-0.26.1 → settfex-0.26.2}/uv.lock +219 -169
- {settfex-0.26.1 → settfex-0.26.2}/.editorconfig +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/.github/dependabot.yml +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/.github/instructions/core-architectrual-principles.instructions.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/.github/instructions/documentation-standards.instructions.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/.github/instructions/file-organization.instructions.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/.github/instructions/git-commit.instructions.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/.github/instructions/python-dependency-management.instructions.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/.github/prompts/Coding.prompt.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/.github/prompts/Git-Commit-Reviewer.prompt.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/.github/prompts/Prompt-Engineer.prompt.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/.github/prompts/Python-Architect.prompt.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/.github/workflows/ci.yml +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/.github/workflows/dependency-drift.yml +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/.github/workflows/live-smoke.yml +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/.github/workflows/pre-commit.yml +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/.github/workflows/release.yml +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/.gitignore +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/.pre-commit-config.yaml +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/.python-version +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/AGENTS.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/CLAUDE.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/CODE_OF_CONDUCT.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/COMPREHENSIVE_AUDIT.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/CONTRIBUTING.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/LICENSE +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/README.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/RELEASING.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/SECURITY.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/guide/PYTHON_LIBRARY_BEST_PRACTICES.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/index.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/settfex/services/sec/executive_trades.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/settfex/services/sec/financial_report.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/settfex/services/set/API_PROTECTION_NOTE.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/settfex/services/set/analyst_consensus.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/settfex/services/set/board_of_director.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/settfex/services/set/chart_quotation.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/settfex/services/set/corporate_action.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/settfex/services/set/dr_indicative_price.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/settfex/services/set/earnings_call.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/settfex/services/set/financial.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/settfex/services/set/highlight_data.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/settfex/services/set/holiday.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/settfex/services/set/index.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/settfex/services/set/info.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/settfex/services/set/latest_historical_trading.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/settfex/services/set/list.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/settfex/services/set/news.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/settfex/services/set/nvdr_holder.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/settfex/services/set/price_performance.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/settfex/services/set/profile_company.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/settfex/services/set/profile_dr.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/settfex/services/set/profile_stock.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/settfex/services/set/shareholder.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/settfex/services/set/trading_stat.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/settfex/services/tfex/list.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/settfex/services/tfex/trading_statistics.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/settfex/services/thaibma/yield_curve.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/settfex/utils/data_fetcher.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/settfex/utils/session_caching.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/solution/FINDINGS.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/solution/Performance Boost Session Caching Implementation.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/solution/SESSION_CACHE_SUMMARY.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/docs/solution/SOLUTION_100_PERCENT.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/README.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/sec/01_financial_report.ipynb +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/sec/02_executive_trades.ipynb +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/set/01_stock_list.ipynb +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/set/02_highlight_data.ipynb +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/set/03_stock_profile.ipynb +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/set/04_company_profile.ipynb +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/set/05_corporate_action.ipynb +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/set/06_shareholder.ipynb +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/set/07_nvdr_holder.ipynb +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/set/08_board_of_director.ipynb +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/set/09_trading_statistics.ipynb +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/set/10_price_performance.ipynb +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/set/11_financial.ipynb +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/set/12_earnings_call.ipynb +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/set/13_chart_quotation.ipynb +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/set/14_latest_historical_trading.ipynb +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/set/15_market_index.ipynb +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/set/16_news.ipynb +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/set/17_holiday.ipynb +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/set/18_dr_and_asset_type.ipynb +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/set/19_analyst_consensus.ipynb +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/set/20_stock_info.ipynb +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/set/README.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/set/cpall_balance_sheet.csv +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/set/market_dashboard_20251005_173221.csv +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/set/market_dashboard_20251005_210737.csv +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/set/market_dashboard_20251006_091440.csv +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/set/thailand_banking_stocks.csv +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/set/thailand_set_main_board.csv +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/set/thailand_stock_universe.csv +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/tfex/01_series_list.ipynb +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/tfex/02_trading_statistics.ipynb +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/tfex/03_underlying_price.ipynb +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/examples/thaibma/01_government_yield_curve.ipynb +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/deprecations.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/exceptions.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/py.typed +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/__init__.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/sec/__init__.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/sec/company.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/sec/constants.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/sec/download.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/sec/executive_trades.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/sec/financial_report.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/sec/sec.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/sec/utils.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/__init__.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/asset_type.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/constants.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/earnings_call.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/holiday.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/index/__init__.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/index/chart_quotation.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/index/composition.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/index/index.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/index/info.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/index/list.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/index/utils.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/list.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/news.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/stock/__init__.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/stock/analyst_consensus.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/stock/board_of_director.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/stock/chart_quotation.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/stock/corporate_action.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/stock/dr_indicative_price.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/stock/financial/__init__.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/stock/financial/financial.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/stock/highlight_data.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/stock/info.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/stock/latest_historical_trading.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/stock/nvdr_holder.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/stock/price_performance.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/stock/profile_company.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/stock/profile_dr.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/stock/profile_stock.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/stock/shareholder.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/stock/stock.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/stock/trading_stat.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/set/stock/utils.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/tfex/__init__.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/tfex/constants.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/tfex/list.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/tfex/trading_statistics.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/tfex/underlying_price.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/thaibma/__init__.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/thaibma/availability.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/thaibma/constants.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/thaibma/history.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/thaibma/thaibma.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/thaibma/utils.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/services/thaibma/yield_curve.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/utils/__init__.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/utils/http.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/utils/parsing.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/utils/session_cache.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/utils/session_manager.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/settfex/utils/youtube_transcript.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/__init__.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/conftest.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/golden/api_surface.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/golden/model_contract/analyst_consensus.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/golden/model_contract/dr_profile.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/golden/model_contract/earnings_call_item.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/golden/model_contract/highlight_data.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/golden/model_contract/holiday_calendar.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/golden/model_contract/index_list_response.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/golden/model_contract/news_search_response.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/golden/model_contract/sec_company_match.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/golden/model_contract/sec_executive_trade.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/golden/model_contract/sec_executive_trade_report.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/golden/model_contract/stock_info.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/golden/model_contract/stock_list_response.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/golden/model_contract/tfex_series_list_response.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/golden/model_contract/tfex_trading_statistics.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/golden/model_contract/tfex_underlying_price.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/golden/model_contract/yield_curve.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/integration/__init__.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/integration/conftest.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/integration/test_live_endpoints.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/__init__.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/__init__.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/derive_r59_fixtures.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/derive_th_fixtures.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/README.md +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/capital_indirection_en.html +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/en_mother_fs_h1_2025.html +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/en_ptt_56_1.html +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/en_ptt_56_2.html +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/en_ptt_fs_h1_2025.html +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/en_ptt_viewmore_56_2.html +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/idisc_505_error_page.html +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592000082610_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592000092610_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592000102610_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592000142610_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592000152610_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592000392610_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592000452610_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592000522610_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592000532609_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592000542609_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592001242610_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592001262610_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592001352609_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592001352610_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592001372609_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592001432610_en.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592001432610_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592002622609_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592002632609_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592002772609_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592002782609_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592002882609_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592002892609_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592003112609_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592003122609_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592003452609_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592003462609_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592003632609_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592003652609_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592004042609_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592004052609_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592004192609_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592004202609_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592004532609_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592004542609_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592004802609_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592004812609_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592004992609_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592005002609_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592005172609_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592005182609_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/detail_592005512609_th.json +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/en_default_20261007.html +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/th_capped_rcv_20261002.html +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/th_default_20261007.html +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/th_edge_rows.html +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/th_empty.html +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/th_kcg_txn_202609.html +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/th_sep_pairs.html +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/r59/th_spali_txn_202609.html +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/th_cpall_viewmore_56_1.html +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/th_mother_fs_h1_2025.html +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/th_ptt_56_1.html +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/th_ptt_56_2.html +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/fixtures_sec/th_ptt_fs_h1_2025.html +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/test_code_isolation.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/test_company.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/test_download.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/test_download_evidence.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/test_download_indirection.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/test_download_result.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/test_executive_trades.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/test_financial_report.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/test_financial_report_accounting.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/test_financial_report_th.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/test_listing_transport.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/test_sec.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/test_utils.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/sec/test_view_more_slugs.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/set/__init__.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/set/index/__init__.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/set/index/test_chart_quotation.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/set/index/test_composition.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/set/index/test_index.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/set/index/test_info.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/set/index/test_list.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/set/stock/__init__.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/set/stock/financial/__init__.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/set/stock/financial/test_financial.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/set/stock/test_analyst_consensus.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/set/stock/test_chart_quotation.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/set/stock/test_dr_indicative_price.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/set/stock/test_info.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/set/stock/test_latest_historical_trading.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/set/stock/test_profile_dr.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/set/test_asset_type.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/set/test_board_of_director.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/set/test_client.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/set/test_corporate_action.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/set/test_earnings_call.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/set/test_historical.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/set/test_holiday.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/set/test_list.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/set/test_listed_symbol.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/set/test_news.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/set/test_profile_company.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/set/test_realtime.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/set/test_shareholder.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/set/test_symbol_suggestion.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/test_fault_matrix.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/tfex/__init__.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/tfex/test_client.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/tfex/test_historical.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/tfex/test_list.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/tfex/test_realtime.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/tfex/test_trading_statistics.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/tfex/test_underlying_price.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/thaibma/__init__.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/thaibma/fixtures.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/thaibma/test_availability.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/thaibma/test_history.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/thaibma/test_thaibma.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/thaibma/test_utils.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/services/thaibma/test_yield_curve.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/test_deprecations.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/test_documented_exceptions.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/test_impersonate_target.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/test_model_contract.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/test_not_found_taxonomy.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/test_public_api_surface.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/test_readme_links.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/test_typing_surface.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/utils/__init__.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/utils/test_blocked_error.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/utils/test_formatting.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/utils/test_http.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/utils/test_logging.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/utils/test_parsing.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/utils/test_session_cache.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/utils/test_session_manager.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/utils/test_validation.py +0 -0
- {settfex-0.26.1 → settfex-0.26.2}/tests/utils/test_youtube_transcript.py +0 -0
|
@@ -59,7 +59,12 @@ jobs:
|
|
|
59
59
|
cache-dependency-glob: "uv.lock"
|
|
60
60
|
|
|
61
61
|
- run: uv python install 3.12
|
|
62
|
-
-
|
|
62
|
+
# --all-extras: pip-audit inspects what is INSTALLED, and the dev group alone leaves out
|
|
63
|
+
# the `examples` extra (jupyter, notebook, matplotlib), so its whole tree went unaudited.
|
|
64
|
+
# Found 2026-11-02: a full-lock audit showed 103 advisories in 9 packages there, while this
|
|
65
|
+
# job printed "No known vulnerabilities found". (`--all-groups` would not have helped: groups
|
|
66
|
+
# are not extras.) The bandit job keeps the dev sync, because it scans settfex/ itself.
|
|
67
|
+
- run: uv sync --group dev --all-extras --frozen
|
|
63
68
|
|
|
64
69
|
# Non-blocking: surfaces dependency CVEs for triage without blocking PRs.
|
|
65
70
|
# Some advisories are transitive or not-yet-fixed upstream (e.g. no fix
|
|
@@ -7,6 +7,42 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.26.2] - 2026-11-02
|
|
11
|
+
|
|
12
|
+
Two logging fixes, and a Security workflow that now audits every extra. No API change.
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- **With settfex logging enabled, a failed request whose error text contained braces raised
|
|
17
|
+
`KeyError` instead of its own error** (`settfex.utils.data_fetcher`). The standalone request path
|
|
18
|
+
logged with `logger.error(f"...{e}", exc_info=True)`. `exc_info` is a stdlib-logging argument:
|
|
19
|
+
loguru treats any keyword as a format argument and ran `str.format()` on the already-interpolated
|
|
20
|
+
message, so an error such as `"... {'k': 1} ..."` made the logging call itself raise. That
|
|
21
|
+
replaced the real error, which was never re-raised. The error is now passed as an argument
|
|
22
|
+
(`logger.error("Request failed: {}", e)`). No traceback is logged, deliberately: with
|
|
23
|
+
`setup_logger()`'s `diagnose=True` a traceback would print frame locals. Only reachable after
|
|
24
|
+
`logger.enable("settfex")` or `setup_logger()`, because settfex logging has been off by default
|
|
25
|
+
since 0.24.2. Found while comparing security findings with a sibling library.
|
|
26
|
+
|
|
27
|
+
### Security
|
|
28
|
+
|
|
29
|
+
- **`setup_logger()` no longer prints variable values in logged tracebacks**
|
|
30
|
+
(`settfex.utils.logging`). Both sinks it adds (console and `log_file`) used loguru's
|
|
31
|
+
`diagnose=True`, which annotates every traceback frame with its local variables. loguru itself
|
|
32
|
+
advises against that in production, because it leaks data: a caller's `logger.exception()` whose
|
|
33
|
+
traceback ran through a frame holding a cookie or token would write the value to the console and
|
|
34
|
+
the log file. Both sinks now use `diagnose=False`; `backtrace=True` stays, because it only
|
|
35
|
+
extends the frame list. loguru's own default stderr handler belongs to the host process, and
|
|
36
|
+
`setup_logger()` still never removes a handler it did not add. Remove it yourself if you need the
|
|
37
|
+
same guarantee there. A test drives a real `logger.exception()` through a frame holding a secret
|
|
38
|
+
and asserts it reaches neither sink.
|
|
39
|
+
- **The Security workflow now audits every extra** (`--all-extras`). It used to sync only the dev
|
|
40
|
+
group, so the `examples` extra (jupyter, notebook, matplotlib) was never audited. A full-lock
|
|
41
|
+
audit found 103 advisories in 9 packages there, all now bumped in `uv.lock` (pillow 13.0.0,
|
|
42
|
+
tornado 6.6, mistune 3.4.0, soupsieve 2.9.2, nbconvert 7.17.2, anyio 4.14.2, bleach 6.4.0,
|
|
43
|
+
fonttools 4.68.0, jupyter-server 2.21.1). Lock-only: the published wheel's requirements are
|
|
44
|
+
unchanged, and `pip install settfex[examples]` always resolved current versions.
|
|
45
|
+
|
|
10
46
|
## [0.26.1] - 2026-11-02
|
|
11
47
|
|
|
12
48
|
**Security: settfex no longer depends on `diskcache`, and nothing it caches is ever unpickled.**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: settfex
|
|
3
|
-
Version: 0.26.
|
|
3
|
+
Version: 0.26.2
|
|
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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "settfex"
|
|
3
|
-
version = "0.26.
|
|
3
|
+
version = "0.26.2"
|
|
4
4
|
description = "Async Python library for fetching real-time and historical data from the Stock Exchange of Thailand (SET) and Thailand Futures Exchange (TFEX)"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.11"
|
|
@@ -288,7 +288,11 @@ class AsyncDataFetcher:
|
|
|
288
288
|
logger.debug(f"Request completed: status={response.status_code}, url={url}")
|
|
289
289
|
return response
|
|
290
290
|
except Exception as e:
|
|
291
|
-
|
|
291
|
+
# The error goes in as an ARGUMENT, so loguru never reads braces in its text as
|
|
292
|
+
# format fields. (`exc_info=True` here made loguru str.format() the f-string, and
|
|
293
|
+
# an error text like "{'k': 1}" raised KeyError in place of the real error.)
|
|
294
|
+
# No traceback on purpose: loguru's diagnose mode would print frame locals.
|
|
295
|
+
logger.error("Request failed: {}", e)
|
|
292
296
|
raise
|
|
293
297
|
|
|
294
298
|
async def fetch(
|
|
@@ -108,7 +108,12 @@ def setup_logger(
|
|
|
108
108
|
colorize=colorize,
|
|
109
109
|
filter=filter,
|
|
110
110
|
backtrace=True,
|
|
111
|
-
diagnose=
|
|
111
|
+
# diagnose=False: loguru's diagnose mode prints every frame's LOCAL VARIABLES in a
|
|
112
|
+
# logged traceback, and loguru itself advises turning it off in production because
|
|
113
|
+
# that leaks data. A caller's logger.exception() whose traceback passes through
|
|
114
|
+
# settfex frames would otherwise print what those frames hold. backtrace=True only
|
|
115
|
+
# extends the frame list; it prints no values.
|
|
116
|
+
diagnose=False,
|
|
112
117
|
)
|
|
113
118
|
)
|
|
114
119
|
|
|
@@ -127,7 +132,7 @@ def setup_logger(
|
|
|
127
132
|
compression="zip",
|
|
128
133
|
filter=filter,
|
|
129
134
|
backtrace=True,
|
|
130
|
-
diagnose=
|
|
135
|
+
diagnose=False, # see the console handler above
|
|
131
136
|
)
|
|
132
137
|
)
|
|
133
138
|
|
|
@@ -581,3 +581,36 @@ class TestAsyncDataFetcherPost:
|
|
|
581
581
|
|
|
582
582
|
assert resp.content == raw
|
|
583
583
|
assert resp.encoding == "latin1"
|
|
584
|
+
|
|
585
|
+
|
|
586
|
+
class TestRequestFailureLogging:
|
|
587
|
+
"""A failed request must re-raise ITS OWN exception, whatever its text contains.
|
|
588
|
+
|
|
589
|
+
The except-branch used to call ``logger.error(f"...{e}", exc_info=True)``. ``exc_info`` is a
|
|
590
|
+
stdlib-logging argument; loguru treats any keyword as a format argument and runs
|
|
591
|
+
``str.format()`` on the already-interpolated message, so an error text containing braces
|
|
592
|
+
(a JSON fragment, a dict repr) made the LOGGING call raise ``KeyError`` and replace the real
|
|
593
|
+
error. It fired only with settfex logging enabled (disabled by default since 0.24.2).
|
|
594
|
+
"""
|
|
595
|
+
|
|
596
|
+
@pytest.mark.asyncio
|
|
597
|
+
async def test_braces_in_the_error_text_do_not_replace_the_error(self) -> None:
|
|
598
|
+
from loguru import logger
|
|
599
|
+
|
|
600
|
+
records: list[str] = []
|
|
601
|
+
logger.enable("settfex")
|
|
602
|
+
sink = logger.add(lambda m: records.append(m.record["message"]), level="ERROR")
|
|
603
|
+
try:
|
|
604
|
+
fetcher = AsyncDataFetcher(config=FetcherConfig(use_session=False, max_retries=0))
|
|
605
|
+
boom = ConnectionError("upstream said {'k': 1} and {0}")
|
|
606
|
+
with (
|
|
607
|
+
patch("settfex.utils.data_fetcher.requests.get", side_effect=boom),
|
|
608
|
+
pytest.raises(ConnectionError) as excinfo,
|
|
609
|
+
):
|
|
610
|
+
await fetcher._make_request("https://x/y", headers={})
|
|
611
|
+
finally:
|
|
612
|
+
logger.remove(sink)
|
|
613
|
+
logger.disable("settfex")
|
|
614
|
+
|
|
615
|
+
assert excinfo.value is boom, "the logging call must not swap the exception"
|
|
616
|
+
assert records == ["Request failed: upstream said {'k': 1} and {0}"]
|
|
@@ -335,3 +335,46 @@ class TestEnableMustComeAfterTheImport:
|
|
|
335
335
|
assert "settfex." in log.read_text(encoding="utf-8"), (
|
|
336
336
|
'logger.enable("settfex") after `import settfex` must make settfex audible'
|
|
337
337
|
)
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
class TestSetupLoggerDoesNotPrintFrameLocals:
|
|
341
|
+
"""setup_logger()'s sinks run with diagnose=False: a logged traceback carries no values.
|
|
342
|
+
|
|
343
|
+
loguru's diagnose mode annotates every traceback frame with its local variables. A caller's
|
|
344
|
+
``logger.exception()`` whose traceback passes through a frame holding a secret would write
|
|
345
|
+
that secret to the console and the log file.
|
|
346
|
+
"""
|
|
347
|
+
|
|
348
|
+
def test_a_secret_in_a_frame_local_stays_out_of_the_log_file(self, tmp_path: Path) -> None:
|
|
349
|
+
log = tmp_path / "trace.log"
|
|
350
|
+
result = run_in_fresh_interpreter(
|
|
351
|
+
f"""
|
|
352
|
+
from loguru import logger
|
|
353
|
+
from settfex.utils.logging import setup_logger
|
|
354
|
+
|
|
355
|
+
# Drop loguru's own default stderr handler (diagnose=True by loguru's default). It is
|
|
356
|
+
# the host's, and setup_logger() never removes a handler it did not add, so stderr
|
|
357
|
+
# would carry the value through it. This test is about the two sinks settfex adds.
|
|
358
|
+
logger.remove()
|
|
359
|
+
setup_logger(level="DEBUG", log_file={str(log)!r})
|
|
360
|
+
|
|
361
|
+
def send(cookie):
|
|
362
|
+
raise RuntimeError("request failed")
|
|
363
|
+
|
|
364
|
+
def handler():
|
|
365
|
+
session_cookie = "TOPSECRET-incap-value"
|
|
366
|
+
send(session_cookie) # diagnose annotates the names on a traceback line
|
|
367
|
+
|
|
368
|
+
try:
|
|
369
|
+
handler()
|
|
370
|
+
except RuntimeError:
|
|
371
|
+
logger.exception("caller logs the failure")
|
|
372
|
+
logger.remove()
|
|
373
|
+
""",
|
|
374
|
+
tmp_path,
|
|
375
|
+
)
|
|
376
|
+
assert result.returncode == 0, result.stderr
|
|
377
|
+
text = log.read_text(encoding="utf-8")
|
|
378
|
+
assert "RuntimeError: request failed" in text, "the traceback itself must still be logged"
|
|
379
|
+
assert "TOPSECRET" not in text, "diagnose mode printed a frame local into the log file"
|
|
380
|
+
assert "TOPSECRET" not in result.stderr, "diagnose mode printed a frame local to stderr"
|