chstockdata 0.2.0__tar.gz → 0.4.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.
Files changed (134) hide show
  1. chstockdata-0.4.2/MANIFEST.in +6 -0
  2. {chstockdata-0.2.0/src/chstockdata.egg-info → chstockdata-0.4.2}/PKG-INFO +72 -9
  3. {chstockdata-0.2.0 → chstockdata-0.4.2}/README.md +66 -5
  4. chstockdata-0.4.2/docs/audits/evidence/2026-10-10-v0.4.2-tdx-historical-execution/tdx_history_responses.jsonl +24 -0
  5. chstockdata-0.4.2/docs/audits/evidence/2026-10-10-v0.4.2-tdx-historical-execution/tdx_opening_page_final_responses.jsonl +4 -0
  6. chstockdata-0.4.2/docs/audits/evidence/2026-10-10-v0.4.2-tdx-historical-execution/tdx_opening_page_followup_responses.jsonl +7 -0
  7. chstockdata-0.4.2/docs/audits/evidence/2026-10-10-v0.4.2-tdx-historical-execution/tdx_opening_page_responses.jsonl +9 -0
  8. {chstockdata-0.2.0 → chstockdata-0.4.2}/pyproject.toml +7 -5
  9. chstockdata-0.4.2/scripts/check_release_version.py +215 -0
  10. chstockdata-0.4.2/scripts/check_rh1_static.py +222 -0
  11. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata/__init__.py +241 -179
  12. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata/_easy_tdx_bridge.py +293 -293
  13. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata/a_stock.py +8071 -7606
  14. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata/adjusted_bars.py +728 -725
  15. chstockdata-0.4.2/src/chstockdata/capabilities.py +221 -0
  16. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata/config.py +36 -0
  17. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata/corporate_actions.py +859 -422
  18. chstockdata-0.4.2/src/chstockdata/daily_bars.py +910 -0
  19. chstockdata-0.4.2/src/chstockdata/delisting.py +484 -0
  20. chstockdata-0.4.2/src/chstockdata/fetch_result.py +342 -0
  21. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata/mcp_server.py +29 -12
  22. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata/northbound_data.py +585 -585
  23. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata/northbound_store.py +219 -219
  24. chstockdata-0.4.2/src/chstockdata/opening_evidence.py +533 -0
  25. chstockdata-0.4.2/src/chstockdata/opening_known_events.json +96 -0
  26. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata/point_in_time.py +140 -140
  27. chstockdata-0.4.2/src/chstockdata/quote_chain.py +438 -0
  28. chstockdata-0.4.2/src/chstockdata/routing_observation.py +61 -0
  29. chstockdata-0.4.2/src/chstockdata/suspension.py +301 -0
  30. chstockdata-0.4.2/src/chstockdata/tradability.py +336 -0
  31. chstockdata-0.4.2/src/chstockdata/trading_calendar.py +843 -0
  32. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata/vendor_errors.py +37 -0
  33. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata/vipdoc_history.py +48 -13
  34. {chstockdata-0.2.0 → chstockdata-0.4.2/src/chstockdata.egg-info}/PKG-INFO +72 -9
  35. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata.egg-info/SOURCES.txt +53 -1
  36. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata.egg-info/requires.txt +5 -2
  37. chstockdata-0.4.2/tests/fixtures/block_trades/eastmoney-600519-2025-12-12-sanitized.json +32 -0
  38. chstockdata-0.4.2/tests/fixtures/market_breadth/real_2026-09-04_close.json +178 -0
  39. chstockdata-0.4.2/tests/fixtures/market_breadth/real_2026-09-07_intraday.json +217 -0
  40. chstockdata-0.4.2/tests/fixtures/opening/159509-20260911.pdf +0 -0
  41. chstockdata-0.4.2/tests/fixtures/opening/manifest.json +31 -0
  42. chstockdata-0.4.2/tests/fixtures/opening/sse_688432_interval.bin +1 -0
  43. chstockdata-0.4.2/tests/fixtures/opening/szse_159509_announcements_control.bin +1 -0
  44. chstockdata-0.4.2/tests/fixtures/opening/szse_159915_announcements.bin +1 -0
  45. chstockdata-0.4.2/tests/fixtures/vipdoc/price_scale_20221230.json +87 -0
  46. chstockdata-0.4.2/tests/test_astock_financial_yoy_alignment.py +315 -0
  47. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_astock_fundamentals_fix.py +21 -4
  48. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_astock_kline_vipdoc_chain.py +14 -9
  49. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_astock_listing_status.py +73 -0
  50. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_astock_quote_fallback.py +11 -2
  51. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_astock_silent_failure_sentinel.py +6 -2
  52. chstockdata-0.4.2/tests/test_cached_ohlcv_structured.py +516 -0
  53. chstockdata-0.4.2/tests/test_capability_isolation.py +105 -0
  54. chstockdata-0.4.2/tests/test_config_and_warmup_regression.py +119 -0
  55. chstockdata-0.4.2/tests/test_daily_bars_contract.py +680 -0
  56. chstockdata-0.4.2/tests/test_daily_bars_legacy_compat.py +339 -0
  57. chstockdata-0.4.2/tests/test_daily_bars_routing.py +591 -0
  58. chstockdata-0.4.2/tests/test_daily_bars_schema.py +301 -0
  59. chstockdata-0.4.2/tests/test_delisting_structured.py +318 -0
  60. chstockdata-0.4.2/tests/test_fetch_result_core.py +410 -0
  61. chstockdata-0.4.2/tests/test_fund_corporate_actions.py +156 -0
  62. chstockdata-0.4.2/tests/test_historical_opening_evidence.py +504 -0
  63. chstockdata-0.4.2/tests/test_live_capability_probes.py +218 -0
  64. chstockdata-0.4.2/tests/test_market_date.py +25 -0
  65. chstockdata-0.4.2/tests/test_mcp_server.py +13 -0
  66. chstockdata-0.4.2/tests/test_mootdx_capability_health.py +140 -0
  67. chstockdata-0.4.2/tests/test_mootdx_capability_isolation.py +328 -0
  68. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_mootdx_server_selection.py +2 -2
  69. chstockdata-0.4.2/tests/test_release_version.py +54 -0
  70. chstockdata-0.4.2/tests/test_rh1_git_line_endings.py +52 -0
  71. chstockdata-0.4.2/tests/test_routing_observation.py +68 -0
  72. chstockdata-0.4.2/tests/test_structured_semantics_phase11.py +417 -0
  73. chstockdata-0.4.2/tests/test_suspension_source_semantics.py +80 -0
  74. chstockdata-0.4.2/tests/test_suspension_structured.py +215 -0
  75. chstockdata-0.4.2/tests/test_tradability.py +744 -0
  76. chstockdata-0.4.2/tests/test_trading_calendar_structured.py +711 -0
  77. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_vipdoc_history.py +17 -1
  78. chstockdata-0.4.2/tests/test_vipdoc_price_scale.py +162 -0
  79. chstockdata-0.2.0/src/chstockdata/trading_calendar.py +0 -397
  80. {chstockdata-0.2.0 → chstockdata-0.4.2}/LICENSE +0 -0
  81. {chstockdata-0.2.0 → chstockdata-0.4.2}/NOTICE +0 -0
  82. {chstockdata-0.2.0 → chstockdata-0.4.2}/setup.cfg +0 -0
  83. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata/block_trades.py +0 -0
  84. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata/board_flow.py +0 -0
  85. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata/chips.py +0 -0
  86. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata/etf_options.py +0 -0
  87. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata/hot_rank.py +0 -0
  88. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata/investor_qa.py +0 -0
  89. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata/limit_up.py +0 -0
  90. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata/market_breadth.py +0 -0
  91. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata/policy_news.py +0 -0
  92. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata/policy_news_models.py +0 -0
  93. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata/policy_news_registry.py +0 -0
  94. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata/policy_news_sources.py +0 -0
  95. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata/provenance.py +0 -0
  96. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata/py.typed +0 -0
  97. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata/refresh_vipdoc.py +0 -0
  98. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata/source_context.py +0 -0
  99. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata/tdx_bridge.py +0 -0
  100. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata/utils.py +0 -0
  101. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata.egg-info/dependency_links.txt +0 -0
  102. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata.egg-info/entry_points.txt +0 -0
  103. {chstockdata-0.2.0 → chstockdata-0.4.2}/src/chstockdata.egg-info/top_level.txt +0 -0
  104. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_astock_cls_v1.py +0 -0
  105. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_astock_daily_lhb.py +0 -0
  106. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_astock_earnings_forecast.py +0 -0
  107. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_astock_eastmoney_fix.py +0 -0
  108. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_astock_em_post.py +0 -0
  109. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_astock_interface_fix.py +0 -0
  110. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_astock_lhb_seat_dimension.py +0 -0
  111. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_astock_macro_indicators.py +0 -0
  112. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_astock_margin_valuation.py +0 -0
  113. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_astock_pledge_buyback.py +0 -0
  114. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_astock_push2_source_scan.py +0 -0
  115. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_astock_research_reports.py +0 -0
  116. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_astock_tdx_fallback.py +0 -0
  117. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_astock_tencent_quote_fix.py +0 -0
  118. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_astock_ticker_routing.py +0 -0
  119. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_astock_v0221_fix.py +0 -0
  120. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_board_flow.py +0 -0
  121. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_calendar_consumers.py +0 -0
  122. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_chip_distribution.py +0 -0
  123. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_data_layer_live_smoke.py +0 -0
  124. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_easy_tdx_bridge.py +0 -0
  125. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_etf_options.py +0 -0
  126. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_free_block_trades.py +0 -0
  127. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_free_market_breadth.py +0 -0
  128. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_free_northbound_history.py +0 -0
  129. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_hot_rank.py +0 -0
  130. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_investor_qa.py +0 -0
  131. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_limit_up.py +0 -0
  132. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_refresh_vipdoc_history.py +0 -0
  133. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_tdx_bridge_health.py +0 -0
  134. {chstockdata-0.2.0 → chstockdata-0.4.2}/tests/test_tdx_request_hygiene.py +0 -0
@@ -0,0 +1,6 @@
1
+ recursive-include tests/fixtures *
2
+ include scripts/check_rh1_static.py scripts/check_release_version.py
3
+ include docs/audits/evidence/2026-10-10-v0.4.2-tdx-historical-execution/tdx_history_responses.jsonl
4
+ include docs/audits/evidence/2026-10-10-v0.4.2-tdx-historical-execution/tdx_opening_page_responses.jsonl
5
+ include docs/audits/evidence/2026-10-10-v0.4.2-tdx-historical-execution/tdx_opening_page_followup_responses.jsonl
6
+ include docs/audits/evidence/2026-10-10-v0.4.2-tdx-historical-execution/tdx_opening_page_final_responses.jsonl
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chstockdata
3
- Version: 0.2.0
4
- Summary: Free China A-share market data toolkit: direct HTTP/TCP vendors (Tencent, mootdx/TDX, Eastmoney, Sina, THS, CLS, SSE/SZSE), no API keys, no third-party data SDKs
3
+ Version: 0.4.2
4
+ Summary: Free China A-share market data toolkit: direct HTTP/TCP vendors (Tencent, mootdx/TDX, Eastmoney, Sina, THS, CLS, SSE/SZSE), no API keys, no mandatory third-party market-data SDK in the core path; optional mootdx/baostock integrations
5
5
  Author: joycoding2000
6
6
  License: Apache License
7
7
  Version 2.0, January 2004
@@ -232,28 +232,41 @@ Requires-Dist: lxml>=4.9.0
232
232
  Requires-Dist: stockstats>=0.6.5
233
233
  Provides-Extra: mootdx
234
234
  Requires-Dist: mootdx>=0.10.0; extra == "mootdx"
235
+ Provides-Extra: opening-pdf
236
+ Requires-Dist: pypdf>=6.0; extra == "opening-pdf"
235
237
  Provides-Extra: baostock
236
238
  Requires-Dist: baostock>=0.8.9; extra == "baostock"
237
239
  Provides-Extra: mcp
238
- Requires-Dist: mcp>=1.0; extra == "mcp"
240
+ Requires-Dist: mcp<2,>=1.0; extra == "mcp"
239
241
  Provides-Extra: dev
240
242
  Requires-Dist: pytest>=8.0; extra == "dev"
241
- Requires-Dist: ruff>=0.6; extra == "dev"
243
+ Requires-Dist: ruff<0.17,>=0.16.6; extra == "dev"
242
244
  Dynamic: license-file
243
245
 
244
246
  # chstockdata
245
247
 
246
248
  Free China A-share market data toolkit — direct HTTP/TCP access to public
247
- quote vendors, **no API keys, no third-party data SDKs** (akshare-free by
248
- design), battle-tested in production by
249
+ quote vendors, **no API keys, no mandatory third-party market-data SDK in
250
+ the core path** (akshare-free by design). Optional integrations are
251
+ available for specific capabilities: `[mootdx]` unlocks the TCP K-line
252
+ primary source, `[baostock]` historical turnover for CYQ chips.
253
+ Battle-tested in production by
249
254
  [TradingAgents-astock](https://github.com/joycoding2000/TradingAgents-astock).
250
255
 
251
256
  ```bash
252
- pip install chstockdata # core (pandas/requests only)
257
+ pip install chstockdata # core package (base dependencies)
253
258
  pip install "chstockdata[mootdx]" # + mootdx TCP K-line source (optional)
254
259
  pip install "chstockdata[baostock]" # + historical turnover for CYQ chips (optional)
260
+ pip install "chstockdata[mcp]" # + MCP server entry point (optional)
255
261
  ```
256
262
 
263
+ The optional profiles are supported independently. The MCP extra currently
264
+ stays on the MCP 1.x API because the MCP 2.x server API is not compatible with
265
+ this entry point. Within that supported range, `mootdx` pins `httpx==0.25.2`
266
+ while MCP 1.x requires `httpx>=0.27.1`; a clean resolver therefore rejects
267
+ `chstockdata[mootdx,mcp]`. Keep those two profiles in separate environments
268
+ until the upstream constraints converge.
269
+
257
270
  ```python
258
271
  from chstockdata import get_stock_data, get_realtime_snapshot, resolve_ticker
259
272
 
@@ -262,7 +275,55 @@ df = get_stock_data("600519", 365) # daily OHLCV, vipdoc/mootdx/Sina chain
262
275
  get_realtime_snapshot("600519") # realtime quote, Tencent -> mootdx -> Sina
263
276
  ```
264
277
 
265
- 53 public functions: K-lines, realtime quotes, fundamentals / three financial
278
+ ## Structured API(v0.4.1 release candidate)
279
+
280
+ The structured surface is additive and returns `FetchResult` objects. The
281
+ quote route keeps its provider functions injectable; `quote_fetchers` below is
282
+ a mapping whose values accept the existing `fetcher(codes, fallback_from=...)`
283
+ shape, and `to_finite_number` is the caller's numeric coercion helper.
284
+
285
+ ```python
286
+ from chstockdata import (
287
+ fetch_realtime_quotes,
288
+ fetch_daily_bars,
289
+ fetch_trading_calendar,
290
+ fetch_suspension_info,
291
+ fetch_delisting_status,
292
+ fetch_tradability,
293
+ )
294
+
295
+ quotes = fetch_realtime_quotes(
296
+ ["600519"], quote_fetchers, quote_number=to_finite_number
297
+ )
298
+ bars = fetch_daily_bars("600519", "2026-01-01", "2026-09-22")
299
+ calendar = fetch_trading_calendar(today="2026-09-22")
300
+ suspension = fetch_suspension_info("600519", "2026-09-22")
301
+ delisting = fetch_delisting_status("600519")
302
+ tradability = fetch_tradability("600519", "2026-09-22")
303
+ ```
304
+
305
+ Consumer-facing status guide:
306
+
307
+ | Field | Meaning |
308
+ |---|---|
309
+ | `metadata.final_status` | Attempt-derived provider/routing conclusion. |
310
+ | `metadata.request_status` | Request-level result consumers should branch on. |
311
+ | `metadata.outcome_status` | Optional engine-declared request override; otherwise `None`. |
312
+ | `metadata.providers_used` | Providers that actually contributed the returned payload. |
313
+ | `metadata.limitations` | Coverage, staleness, partial-data, or validation caveats. |
314
+
315
+ Cache-only results intentionally have `attempts=[]` and
316
+ `final_status="skipped"`, while `request_status` may be
317
+ `"success"` or `"normal_empty"`. Do not mechanically treat
318
+ `succeeded=False` or `final_status="skipped"` as unusable cache data; use
319
+ `request_status` for the request decision. A `tradable=True` result only means
320
+ the currently covered calendar, delisting-date, and suspension facts support
321
+ that verdict; it does not promise complete IPO or listing-lifecycle
322
+ eligibility.
323
+
324
+ The public surface combines legacy callables, structured result types,
325
+ constants, and compatibility exports; `__all__` is not a count of functions.
326
+ It covers K-lines, realtime quotes, fundamentals / three financial
266
327
  statements, valuation history, margin trading, dragon-tiger board (per-stock
267
328
  seats and whole-market daily), lockup expiry, northbound flow, fund flow, board
268
329
  fund flow, industry comparison, concept blocks, block trades, market breadth,
@@ -271,7 +332,9 @@ distribution, ETF option chains (T-quote + greeks + IV), investor Q&A (互动易
271
332
  hot rank / popularity rank / concept hits, insider transactions, shareholder
272
333
  pledge / buyback, corporate actions, earnings forecast, research reports, news
273
334
  wires, policy news, macro indicators, trading calendar, delisting / suspension
274
- info, and more. See `chstockdata/__init__.py` for the full export list.
335
+ info, and more. See `chstockdata/__init__.py` for the full export list. The
336
+ candidate package version is `0.4.1`; `0.3.0` is the prior consumer
337
+ compatibility baseline. This release candidate has not been published.
275
338
 
276
339
  ## Data sources
277
340
 
@@ -1,16 +1,27 @@
1
1
  # chstockdata
2
2
 
3
3
  Free China A-share market data toolkit — direct HTTP/TCP access to public
4
- quote vendors, **no API keys, no third-party data SDKs** (akshare-free by
5
- design), battle-tested in production by
4
+ quote vendors, **no API keys, no mandatory third-party market-data SDK in
5
+ the core path** (akshare-free by design). Optional integrations are
6
+ available for specific capabilities: `[mootdx]` unlocks the TCP K-line
7
+ primary source, `[baostock]` historical turnover for CYQ chips.
8
+ Battle-tested in production by
6
9
  [TradingAgents-astock](https://github.com/joycoding2000/TradingAgents-astock).
7
10
 
8
11
  ```bash
9
- pip install chstockdata # core (pandas/requests only)
12
+ pip install chstockdata # core package (base dependencies)
10
13
  pip install "chstockdata[mootdx]" # + mootdx TCP K-line source (optional)
11
14
  pip install "chstockdata[baostock]" # + historical turnover for CYQ chips (optional)
15
+ pip install "chstockdata[mcp]" # + MCP server entry point (optional)
12
16
  ```
13
17
 
18
+ The optional profiles are supported independently. The MCP extra currently
19
+ stays on the MCP 1.x API because the MCP 2.x server API is not compatible with
20
+ this entry point. Within that supported range, `mootdx` pins `httpx==0.25.2`
21
+ while MCP 1.x requires `httpx>=0.27.1`; a clean resolver therefore rejects
22
+ `chstockdata[mootdx,mcp]`. Keep those two profiles in separate environments
23
+ until the upstream constraints converge.
24
+
14
25
  ```python
15
26
  from chstockdata import get_stock_data, get_realtime_snapshot, resolve_ticker
16
27
 
@@ -19,7 +30,55 @@ df = get_stock_data("600519", 365) # daily OHLCV, vipdoc/mootdx/Sina chain
19
30
  get_realtime_snapshot("600519") # realtime quote, Tencent -> mootdx -> Sina
20
31
  ```
21
32
 
22
- 53 public functions: K-lines, realtime quotes, fundamentals / three financial
33
+ ## Structured API(v0.4.1 release candidate)
34
+
35
+ The structured surface is additive and returns `FetchResult` objects. The
36
+ quote route keeps its provider functions injectable; `quote_fetchers` below is
37
+ a mapping whose values accept the existing `fetcher(codes, fallback_from=...)`
38
+ shape, and `to_finite_number` is the caller's numeric coercion helper.
39
+
40
+ ```python
41
+ from chstockdata import (
42
+ fetch_realtime_quotes,
43
+ fetch_daily_bars,
44
+ fetch_trading_calendar,
45
+ fetch_suspension_info,
46
+ fetch_delisting_status,
47
+ fetch_tradability,
48
+ )
49
+
50
+ quotes = fetch_realtime_quotes(
51
+ ["600519"], quote_fetchers, quote_number=to_finite_number
52
+ )
53
+ bars = fetch_daily_bars("600519", "2026-01-01", "2026-09-22")
54
+ calendar = fetch_trading_calendar(today="2026-09-22")
55
+ suspension = fetch_suspension_info("600519", "2026-09-22")
56
+ delisting = fetch_delisting_status("600519")
57
+ tradability = fetch_tradability("600519", "2026-09-22")
58
+ ```
59
+
60
+ Consumer-facing status guide:
61
+
62
+ | Field | Meaning |
63
+ |---|---|
64
+ | `metadata.final_status` | Attempt-derived provider/routing conclusion. |
65
+ | `metadata.request_status` | Request-level result consumers should branch on. |
66
+ | `metadata.outcome_status` | Optional engine-declared request override; otherwise `None`. |
67
+ | `metadata.providers_used` | Providers that actually contributed the returned payload. |
68
+ | `metadata.limitations` | Coverage, staleness, partial-data, or validation caveats. |
69
+
70
+ Cache-only results intentionally have `attempts=[]` and
71
+ `final_status="skipped"`, while `request_status` may be
72
+ `"success"` or `"normal_empty"`. Do not mechanically treat
73
+ `succeeded=False` or `final_status="skipped"` as unusable cache data; use
74
+ `request_status` for the request decision. A `tradable=True` result only means
75
+ the currently covered calendar, delisting-date, and suspension facts support
76
+ that verdict; it does not promise complete IPO or listing-lifecycle
77
+ eligibility.
78
+
79
+ The public surface combines legacy callables, structured result types,
80
+ constants, and compatibility exports; `__all__` is not a count of functions.
81
+ It covers K-lines, realtime quotes, fundamentals / three financial
23
82
  statements, valuation history, margin trading, dragon-tiger board (per-stock
24
83
  seats and whole-market daily), lockup expiry, northbound flow, fund flow, board
25
84
  fund flow, industry comparison, concept blocks, block trades, market breadth,
@@ -28,7 +87,9 @@ distribution, ETF option chains (T-quote + greeks + IV), investor Q&A (互动易
28
87
  hot rank / popularity rank / concept hits, insider transactions, shareholder
29
88
  pledge / buyback, corporate actions, earnings forecast, research reports, news
30
89
  wires, policy news, macro indicators, trading calendar, delisting / suspension
31
- info, and more. See `chstockdata/__init__.py` for the full export list.
90
+ info, and more. See `chstockdata/__init__.py` for the full export list. The
91
+ candidate package version is `0.4.1`; `0.3.0` is the prior consumer
92
+ compatibility baseline. This release candidate has not been published.
32
93
 
33
94
  ## Data sources
34
95