axdata 0.1.0__py3-none-any.whl
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.
- axdata/__init__.py +16 -0
- axdata/cache.py +19 -0
- axdata/client.py +1223 -0
- axdata-0.1.0.dist-info/METADATA +238 -0
- axdata-0.1.0.dist-info/RECORD +427 -0
- axdata-0.1.0.dist-info/WHEEL +5 -0
- axdata-0.1.0.dist-info/entry_points.txt +8 -0
- axdata-0.1.0.dist-info/licenses/LICENSE +162 -0
- axdata-0.1.0.dist-info/top_level.txt +6 -0
- axdata_core/__init__.py +221 -0
- axdata_core/_tdx_wire/__init__.py +35 -0
- axdata_core/_tdx_wire/_shim.py +140 -0
- axdata_core/_tdx_wire/api/__init__.py +51 -0
- axdata_core/_tdx_wire/api/auction.py +24 -0
- axdata_core/_tdx_wire/api/bars.py +24 -0
- axdata_core/_tdx_wire/api/base.py +26 -0
- axdata_core/_tdx_wire/api/codes.py +25 -0
- axdata_core/_tdx_wire/api/corporate.py +24 -0
- axdata_core/_tdx_wire/api/finance.py +24 -0
- axdata_core/_tdx_wire/api/intraday.py +24 -0
- axdata_core/_tdx_wire/api/quotes.py +26 -0
- axdata_core/_tdx_wire/api/resources.py +25 -0
- axdata_core/_tdx_wire/api/session.py +24 -0
- axdata_core/_tdx_wire/api/trades.py +24 -0
- axdata_core/_tdx_wire/client.py +33 -0
- axdata_core/_tdx_wire/exceptions.py +27 -0
- axdata_core/_tdx_wire/hosts.py +106 -0
- axdata_core/_tdx_wire/models/__init__.py +93 -0
- axdata_core/_tdx_wire/models/auction.py +26 -0
- axdata_core/_tdx_wire/models/corporate.py +27 -0
- axdata_core/_tdx_wire/models/finance.py +26 -0
- axdata_core/_tdx_wire/models/intraday.py +31 -0
- axdata_core/_tdx_wire/models/kline.py +27 -0
- axdata_core/_tdx_wire/models/quote.py +32 -0
- axdata_core/_tdx_wire/models/resource.py +24 -0
- axdata_core/_tdx_wire/models/security.py +24 -0
- axdata_core/_tdx_wire/models/session.py +27 -0
- axdata_core/_tdx_wire/models/subchart.py +25 -0
- axdata_core/_tdx_wire/models/trade.py +28 -0
- axdata_core/_tdx_wire/protocol/__init__.py +49 -0
- axdata_core/_tdx_wire/protocol/commands/__init__.py +43 -0
- axdata_core/_tdx_wire/protocol/commands/auction.py +110 -0
- axdata_core/_tdx_wire/protocol/commands/codec.py +43 -0
- axdata_core/_tdx_wire/protocol/commands/corporate.py +98 -0
- axdata_core/_tdx_wire/protocol/commands/finance.py +96 -0
- axdata_core/_tdx_wire/protocol/commands/intraday.py +122 -0
- axdata_core/_tdx_wire/protocol/commands/klines.py +102 -0
- axdata_core/_tdx_wire/protocol/commands/lookup.py +36 -0
- axdata_core/_tdx_wire/protocol/commands/price_limits.py +89 -0
- axdata_core/_tdx_wire/protocol/commands/quotes.py +102 -0
- axdata_core/_tdx_wire/protocol/commands/registry.py +36 -0
- axdata_core/_tdx_wire/protocol/commands/resources.py +99 -0
- axdata_core/_tdx_wire/protocol/commands/security.py +103 -0
- axdata_core/_tdx_wire/protocol/commands/session.py +82 -0
- axdata_core/_tdx_wire/protocol/commands/subchart.py +97 -0
- axdata_core/_tdx_wire/protocol/commands/trades.py +107 -0
- axdata_core/_tdx_wire/protocol/constants.py +124 -0
- axdata_core/_tdx_wire/protocol/frame.py +68 -0
- axdata_core/_tdx_wire/protocol/unit.py +85 -0
- axdata_core/_tdx_wire/py.typed +1 -0
- axdata_core/_tdx_wire/transport/__init__.py +34 -0
- axdata_core/_tdx_wire/transport/base.py +25 -0
- axdata_core/_tdx_wire/transport/memory.py +24 -0
- axdata_core/_tdx_wire/transport/pool.py +32 -0
- axdata_core/_tdx_wire/transport/socket.py +39 -0
- axdata_core/adapters/__init__.py +0 -0
- axdata_core/adapters/cls/__init__.py +17 -0
- axdata_core/adapters/cls/provider_bridge.py +23 -0
- axdata_core/adapters/cls/request.py +632 -0
- axdata_core/adapters/cls/source_adapter_registry.py +31 -0
- axdata_core/adapters/cninfo/__init__.py +17 -0
- axdata_core/adapters/cninfo/provider_bridge.py +25 -0
- axdata_core/adapters/cninfo/request.py +2425 -0
- axdata_core/adapters/cninfo/source_adapter_registry.py +42 -0
- axdata_core/adapters/eastmoney/__init__.py +17 -0
- axdata_core/adapters/eastmoney/provider_bridge.py +25 -0
- axdata_core/adapters/eastmoney/request.py +1128 -0
- axdata_core/adapters/eastmoney/source_adapter_registry.py +42 -0
- axdata_core/adapters/exchange/__init__.py +17 -0
- axdata_core/adapters/exchange/provider_bridge.py +25 -0
- axdata_core/adapters/exchange/request.py +1214 -0
- axdata_core/adapters/exchange/source_adapter_registry.py +42 -0
- axdata_core/adapters/kph/__init__.py +17 -0
- axdata_core/adapters/kph/provider_bridge.py +23 -0
- axdata_core/adapters/kph/request.py +509 -0
- axdata_core/adapters/kph/source_adapter_registry.py +31 -0
- axdata_core/adapters/sina/__init__.py +17 -0
- axdata_core/adapters/sina/provider_bridge.py +25 -0
- axdata_core/adapters/sina/request.py +5155 -0
- axdata_core/adapters/sina/source_adapter_registry.py +42 -0
- axdata_core/adapters/tdx/__init__.py +32 -0
- axdata_core/adapters/tdx/adjustment.py +50 -0
- axdata_core/adapters/tdx/adjustment_fetch.py +51 -0
- axdata_core/adapters/tdx/auction_fetch.py +51 -0
- axdata_core/adapters/tdx/client_factory.py +110 -0
- axdata_core/adapters/tdx/code_fetch.py +62 -0
- axdata_core/adapters/tdx/codes.py +54 -0
- axdata_core/adapters/tdx/derived_rows.py +69 -0
- axdata_core/adapters/tdx/downloader.py +193 -0
- axdata_core/adapters/tdx/downloader_interface_sets.py +50 -0
- axdata_core/adapters/tdx/downloader_profiles.py +43 -0
- axdata_core/adapters/tdx/downloader_registry.py +115 -0
- axdata_core/adapters/tdx/execution_utils.py +55 -0
- axdata_core/adapters/tdx/f10_executor.py +57 -0
- axdata_core/adapters/tdx/f10_normalize.py +61 -0
- axdata_core/adapters/tdx/f10_params.py +57 -0
- axdata_core/adapters/tdx/f10_postprocess.py +67 -0
- axdata_core/adapters/tdx/f10_render.py +48 -0
- axdata_core/adapters/tdx/f10_request.py +62 -0
- axdata_core/adapters/tdx/finance_fetch.py +61 -0
- axdata_core/adapters/tdx/finance_maps.py +54 -0
- axdata_core/adapters/tdx/finance_normalize.py +57 -0
- axdata_core/adapters/tdx/host_config.py +115 -0
- axdata_core/adapters/tdx/interface_sets.py +50 -0
- axdata_core/adapters/tdx/intraday_fetch.py +68 -0
- axdata_core/adapters/tdx/kline_helpers.py +58 -0
- axdata_core/adapters/tdx/limit_ladder_fetch.py +60 -0
- axdata_core/adapters/tdx/limit_ladder_topics.py +53 -0
- axdata_core/adapters/tdx/normalize_utils.py +75 -0
- axdata_core/adapters/tdx/options.py +61 -0
- axdata_core/adapters/tdx/price_limit_calendar.py +49 -0
- axdata_core/adapters/tdx/price_limit_fetch.py +53 -0
- axdata_core/adapters/tdx/price_limit_history.py +50 -0
- axdata_core/adapters/tdx/price_limits.py +58 -0
- axdata_core/adapters/tdx/provider_bridge.py +68 -0
- axdata_core/adapters/tdx/quote_fetch.py +61 -0
- axdata_core/adapters/tdx/quote_identity.py +49 -0
- axdata_core/adapters/tdx/rank_fetch.py +55 -0
- axdata_core/adapters/tdx/rank_params.py +52 -0
- axdata_core/adapters/tdx/realtime_refresh.py +45 -0
- axdata_core/adapters/tdx/request.py +11 -0
- axdata_core/adapters/tdx/request_adapter_runtime.py +41 -0
- axdata_core/adapters/tdx/request_client.py +51 -0
- axdata_core/adapters/tdx/request_compat.py +89 -0
- axdata_core/adapters/tdx/request_dispatch.py +50 -0
- axdata_core/adapters/tdx/request_filters.py +60 -0
- axdata_core/adapters/tdx/request_host_config.py +110 -0
- axdata_core/adapters/tdx/request_limits.py +59 -0
- axdata_core/adapters/tdx/request_methods.py +41 -0
- axdata_core/adapters/tdx/request_params.py +62 -0
- axdata_core/adapters/tdx/request_seams.py +41 -0
- axdata_core/adapters/tdx/resources/__init__.py +0 -0
- axdata_core/adapters/tdx/resources/finance_maps/__init__.py +0 -0
- axdata_core/adapters/tdx/resources/finance_maps/incon.dat +3702 -0
- axdata_core/adapters/tdx/resources/finance_maps/tdxhy.cfg +5620 -0
- axdata_core/adapters/tdx/resources/finance_maps/tdxzs.cfg +605 -0
- axdata_core/adapters/tdx/security_codes.py +54 -0
- axdata_core/adapters/tdx/series_history.py +57 -0
- axdata_core/adapters/tdx/server_cache.py +58 -0
- axdata_core/adapters/tdx/snapshot_normalize.py +56 -0
- axdata_core/adapters/tdx/source_adapter_registry.py +69 -0
- axdata_core/adapters/tdx/source_execution.py +44 -0
- axdata_core/adapters/tdx/source_execution_registry.py +70 -0
- axdata_core/adapters/tdx/stats_cache.py +184 -0
- axdata_core/adapters/tdx/stats_models.py +159 -0
- axdata_core/adapters/tdx/stats_resource.py +304 -0
- axdata_core/adapters/tdx/status_fetch.py +55 -0
- axdata_core/adapters/tdx/time_series_normalize.py +67 -0
- axdata_core/adapters/tdx/tqlex.py +50 -0
- axdata_core/adapters/tdx/wire_requests.py +60 -0
- axdata_core/adapters/tdx_ext/__init__.py +66 -0
- axdata_core/adapters/tdx_ext/client.py +688 -0
- axdata_core/adapters/tdx_ext/exceptions.py +51 -0
- axdata_core/adapters/tdx_ext/host_config.py +40 -0
- axdata_core/adapters/tdx_ext/interface_sets.py +65 -0
- axdata_core/adapters/tdx_ext/local_cache.py +649 -0
- axdata_core/adapters/tdx_ext/models.py +96 -0
- axdata_core/adapters/tdx_ext/options.py +36 -0
- axdata_core/adapters/tdx_ext/pool.py +153 -0
- axdata_core/adapters/tdx_ext/provider_bridge.py +35 -0
- axdata_core/adapters/tdx_ext/request.py +498 -0
- axdata_core/adapters/tdx_ext/request_execution.py +118 -0
- axdata_core/adapters/tdx_ext/request_instruments.py +221 -0
- axdata_core/adapters/tdx_ext/request_normalize.py +356 -0
- axdata_core/adapters/tdx_ext/request_params.py +157 -0
- axdata_core/adapters/tdx_ext/request_series.py +98 -0
- axdata_core/adapters/tdx_ext/server_cache.py +13 -0
- axdata_core/adapters/tdx_ext/servers.py +35 -0
- axdata_core/adapters/tdx_ext/source_adapter_registry.py +42 -0
- axdata_core/adapters/tdx_ext/source_execution.py +19 -0
- axdata_core/adapters/tdx_ext/source_execution_registry.py +43 -0
- axdata_core/adapters/tencent/__init__.py +17 -0
- axdata_core/adapters/tencent/provider_bridge.py +25 -0
- axdata_core/adapters/tencent/request.py +729 -0
- axdata_core/adapters/tencent/source_adapter_registry.py +42 -0
- axdata_core/axp.py +1843 -0
- axdata_core/builtin_providers.py +586 -0
- axdata_core/builtin_source_declarations.py +156 -0
- axdata_core/cli.py +1818 -0
- axdata_core/collector_registry.py +227 -0
- axdata_core/collector_runner.py +1016 -0
- axdata_core/collector_scheduler.py +3155 -0
- axdata_core/collector_templates.py +339 -0
- axdata_core/data_browser.py +1696 -0
- axdata_core/diagnostics.py +734 -0
- axdata_core/downloader_engine.py +1480 -0
- axdata_core/downloader_registry.py +62 -0
- axdata_core/downloaders.py +1619 -0
- axdata_core/legacy_provider_adapter.py +68 -0
- axdata_core/paths.py +51 -0
- axdata_core/plugin_config.py +272 -0
- axdata_core/plugin_status.py +419 -0
- axdata_core/plugins.py +1363 -0
- axdata_core/provider_catalog.py +462 -0
- axdata_core/provider_registry.py +833 -0
- axdata_core/quality.py +86 -0
- axdata_core/query.py +242 -0
- axdata_core/resources/__init__.py +2 -0
- axdata_core/resources/tdx_extended_servers.json +22 -0
- axdata_core/resources/tdx_quote_servers.json +49 -0
- axdata_core/sample_collectors.py +42 -0
- axdata_core/schema.py +385 -0
- axdata_core/source_adapter_factory.py +95 -0
- axdata_core/source_adapter_options.py +18 -0
- axdata_core/source_errors.py +43 -0
- axdata_core/source_execution_options.py +37 -0
- axdata_core/source_execution_registry.py +27 -0
- axdata_core/source_projection.py +21 -0
- axdata_core/source_request.py +441 -0
- axdata_core/source_session.py +355 -0
- axdata_core/sources/__init__.py +40 -0
- axdata_core/sources/base.py +112 -0
- axdata_core/sources/catalog.py +60 -0
- axdata_core/sources/cls/__init__.py +5 -0
- axdata_core/sources/cls/catalog.py +231 -0
- axdata_core/sources/cninfo/__init__.py +5 -0
- axdata_core/sources/cninfo/catalog.py +1994 -0
- axdata_core/sources/display_docs.py +139 -0
- axdata_core/sources/eastmoney/__init__.py +5 -0
- axdata_core/sources/eastmoney/catalog.py +509 -0
- axdata_core/sources/exchange/__init__.py +5 -0
- axdata_core/sources/exchange/catalog.py +361 -0
- axdata_core/sources/kph/__init__.py +5 -0
- axdata_core/sources/kph/catalog.py +255 -0
- axdata_core/sources/sina/__init__.py +5 -0
- axdata_core/sources/sina/catalog.py +2951 -0
- axdata_core/sources/tdx/__init__.py +5 -0
- axdata_core/sources/tdx/catalog.py +4546 -0
- axdata_core/sources/tdx_ext/__init__.py +5 -0
- axdata_core/sources/tdx_ext/catalog.py +1518 -0
- axdata_core/sources/tencent/__init__.py +5 -0
- axdata_core/sources/tencent/catalog.py +370 -0
- axdata_core/storage.py +186 -0
- axdata_core/tdx_f10_catalog.py +52 -0
- axdata_core/tdx_f10_models.py +50 -0
- axdata_core/tdx_f10_names.py +47 -0
- axdata_core/tdx_f10_specs.py +56 -0
- axdata_core/tdx_plugin_required.py +43 -0
- axdata_core/tdx_server_config.py +65 -0
- axdata_core/trade_calendar_cache.py +397 -0
- axdata_source_cninfo/__init__.py +15 -0
- axdata_source_cninfo/adapter.py +31 -0
- axdata_source_cninfo/axdata-provider.json +384 -0
- axdata_source_cninfo/catalog.py +209 -0
- axdata_source_cninfo/metadata.py +8 -0
- axdata_source_cninfo/provider.py +41 -0
- axdata_source_tdx/__init__.py +15 -0
- axdata_source_tdx/_tdx_wire/__init__.py +26 -0
- axdata_source_tdx/_tdx_wire/_binary.py +218 -0
- axdata_source_tdx/_tdx_wire/_code_utils.py +42 -0
- axdata_source_tdx/_tdx_wire/_command_codec.py +186 -0
- axdata_source_tdx/_tdx_wire/_command_codes.py +74 -0
- axdata_source_tdx/_tdx_wire/_command_defaults.py +15 -0
- axdata_source_tdx/_tdx_wire/_command_dispatch.py +96 -0
- axdata_source_tdx/_tdx_wire/_command_layouts.py +96 -0
- axdata_source_tdx/_tdx_wire/_command_lookup.py +25 -0
- axdata_source_tdx/_tdx_wire/_command_metadata.py +32 -0
- axdata_source_tdx/_tdx_wire/_command_registry.py +61 -0
- axdata_source_tdx/_tdx_wire/_connection_defaults.py +13 -0
- axdata_source_tdx/_tdx_wire/_host_defaults.py +51 -0
- axdata_source_tdx/_tdx_wire/_host_probe.py +81 -0
- axdata_source_tdx/_tdx_wire/_host_resource.py +70 -0
- axdata_source_tdx/_tdx_wire/_host_utils.py +31 -0
- axdata_source_tdx/_tdx_wire/_market.py +66 -0
- axdata_source_tdx/_tdx_wire/_request_defaults.py +11 -0
- axdata_source_tdx/_tdx_wire/_security_classification.py +61 -0
- axdata_source_tdx/_tdx_wire/_time_utils.py +7 -0
- axdata_source_tdx/_tdx_wire/api/__init__.py +45 -0
- axdata_source_tdx/_tdx_wire/api/auction.py +25 -0
- axdata_source_tdx/_tdx_wire/api/bars.py +31 -0
- axdata_source_tdx/_tdx_wire/api/base.py +39 -0
- axdata_source_tdx/_tdx_wire/api/codes.py +25 -0
- axdata_source_tdx/_tdx_wire/api/corporate.py +11 -0
- axdata_source_tdx/_tdx_wire/api/finance.py +10 -0
- axdata_source_tdx/_tdx_wire/api/intraday.py +38 -0
- axdata_source_tdx/_tdx_wire/api/quotes.py +78 -0
- axdata_source_tdx/_tdx_wire/api/resources.py +34 -0
- axdata_source_tdx/_tdx_wire/api/session.py +16 -0
- axdata_source_tdx/_tdx_wire/api/trades.py +34 -0
- axdata_source_tdx/_tdx_wire/client.py +470 -0
- axdata_source_tdx/_tdx_wire/exceptions.py +25 -0
- axdata_source_tdx/_tdx_wire/hosts.py +27 -0
- axdata_source_tdx/_tdx_wire/models/__init__.py +87 -0
- axdata_source_tdx/_tdx_wire/models/auction.py +58 -0
- axdata_source_tdx/_tdx_wire/models/corporate.py +59 -0
- axdata_source_tdx/_tdx_wire/models/finance.py +80 -0
- axdata_source_tdx/_tdx_wire/models/intraday.py +112 -0
- axdata_source_tdx/_tdx_wire/models/kline.py +58 -0
- axdata_source_tdx/_tdx_wire/models/quote.py +262 -0
- axdata_source_tdx/_tdx_wire/models/resource.py +18 -0
- axdata_source_tdx/_tdx_wire/models/security.py +28 -0
- axdata_source_tdx/_tdx_wire/models/session.py +30 -0
- axdata_source_tdx/_tdx_wire/models/subchart.py +39 -0
- axdata_source_tdx/_tdx_wire/models/trade.py +46 -0
- axdata_source_tdx/_tdx_wire/protocol/__init__.py +43 -0
- axdata_source_tdx/_tdx_wire/protocol/_frame_constants.py +5 -0
- axdata_source_tdx/_tdx_wire/protocol/commands/__init__.py +37 -0
- axdata_source_tdx/_tdx_wire/protocol/commands/auction.py +165 -0
- axdata_source_tdx/_tdx_wire/protocol/commands/codec.py +37 -0
- axdata_source_tdx/_tdx_wire/protocol/commands/corporate.py +163 -0
- axdata_source_tdx/_tdx_wire/protocol/commands/finance.py +180 -0
- axdata_source_tdx/_tdx_wire/protocol/commands/intraday.py +382 -0
- axdata_source_tdx/_tdx_wire/protocol/commands/klines.py +396 -0
- axdata_source_tdx/_tdx_wire/protocol/commands/lookup.py +31 -0
- axdata_source_tdx/_tdx_wire/protocol/commands/price_limits.py +110 -0
- axdata_source_tdx/_tdx_wire/protocol/commands/quotes.py +804 -0
- axdata_source_tdx/_tdx_wire/protocol/commands/registry.py +30 -0
- axdata_source_tdx/_tdx_wire/protocol/commands/resources.py +107 -0
- axdata_source_tdx/_tdx_wire/protocol/commands/security.py +163 -0
- axdata_source_tdx/_tdx_wire/protocol/commands/session.py +129 -0
- axdata_source_tdx/_tdx_wire/protocol/commands/subchart.py +182 -0
- axdata_source_tdx/_tdx_wire/protocol/commands/trades.py +275 -0
- axdata_source_tdx/_tdx_wire/protocol/constants.py +70 -0
- axdata_source_tdx/_tdx_wire/protocol/frame.py +141 -0
- axdata_source_tdx/_tdx_wire/protocol/unit.py +98 -0
- axdata_source_tdx/_tdx_wire/py.typed +1 -0
- axdata_source_tdx/_tdx_wire/transport/__init__.py +28 -0
- axdata_source_tdx/_tdx_wire/transport/base.py +21 -0
- axdata_source_tdx/_tdx_wire/transport/memory.py +42 -0
- axdata_source_tdx/_tdx_wire/transport/pool.py +148 -0
- axdata_source_tdx/_tdx_wire/transport/socket.py +373 -0
- axdata_source_tdx/adapter.py +31 -0
- axdata_source_tdx/adjustment.py +163 -0
- axdata_source_tdx/adjustment_fetch.py +148 -0
- axdata_source_tdx/auction_fetch.py +162 -0
- axdata_source_tdx/axdata-provider.json +23680 -0
- axdata_source_tdx/catalog.py +39 -0
- axdata_source_tdx/client_factory.py +61 -0
- axdata_source_tdx/code_fetch.py +579 -0
- axdata_source_tdx/codes.py +69 -0
- axdata_source_tdx/collectors.py +525 -0
- axdata_source_tdx/derived_rows.py +500 -0
- axdata_source_tdx/downloader.py +139 -0
- axdata_source_tdx/downloader_interface_sets.py +29 -0
- axdata_source_tdx/downloader_profiles.py +731 -0
- axdata_source_tdx/downloader_registry.py +85 -0
- axdata_source_tdx/execution_utils.py +141 -0
- axdata_source_tdx/f10_executor.py +414 -0
- axdata_source_tdx/f10_normalize.py +169 -0
- axdata_source_tdx/f10_params.py +221 -0
- axdata_source_tdx/f10_postprocess.py +405 -0
- axdata_source_tdx/f10_render.py +29 -0
- axdata_source_tdx/f10_request.py +365 -0
- axdata_source_tdx/finance_fetch.py +514 -0
- axdata_source_tdx/finance_maps.py +377 -0
- axdata_source_tdx/finance_normalize.py +273 -0
- axdata_source_tdx/host_config.py +51 -0
- axdata_source_tdx/interface_sets.py +180 -0
- axdata_source_tdx/intraday_fetch.py +600 -0
- axdata_source_tdx/kline_helpers.py +333 -0
- axdata_source_tdx/limit_ladder_fetch.py +614 -0
- axdata_source_tdx/limit_ladder_topics.py +280 -0
- axdata_source_tdx/metadata.py +8 -0
- axdata_source_tdx/normalize_utils.py +264 -0
- axdata_source_tdx/options.py +195 -0
- axdata_source_tdx/price_limit_calendar.py +106 -0
- axdata_source_tdx/price_limit_fetch.py +264 -0
- axdata_source_tdx/price_limit_history.py +100 -0
- axdata_source_tdx/price_limits.py +142 -0
- axdata_source_tdx/provider.py +44 -0
- axdata_source_tdx/provider_bridge.py +43 -0
- axdata_source_tdx/quote_fetch.py +485 -0
- axdata_source_tdx/quote_identity.py +50 -0
- axdata_source_tdx/rank_fetch.py +316 -0
- axdata_source_tdx/rank_params.py +181 -0
- axdata_source_tdx/realtime_refresh.py +51 -0
- axdata_source_tdx/request_adapter.py +533 -0
- axdata_source_tdx/request_adapter_runtime.py +302 -0
- axdata_source_tdx/request_client.py +98 -0
- axdata_source_tdx/request_compat.py +432 -0
- axdata_source_tdx/request_dispatch.py +138 -0
- axdata_source_tdx/request_entrypoints.py +146 -0
- axdata_source_tdx/request_filters.py +154 -0
- axdata_source_tdx/request_host_config.py +103 -0
- axdata_source_tdx/request_limits.py +15 -0
- axdata_source_tdx/request_methods.py +1910 -0
- axdata_source_tdx/request_params.py +225 -0
- axdata_source_tdx/request_seams.py +534 -0
- axdata_source_tdx/resources/__init__.py +0 -0
- axdata_source_tdx/resources/finance_maps/__init__.py +1 -0
- axdata_source_tdx/resources/finance_maps/incon.dat +3702 -0
- axdata_source_tdx/resources/finance_maps/tdxhy.cfg +5620 -0
- axdata_source_tdx/resources/finance_maps/tdxzs.cfg +605 -0
- axdata_source_tdx/resources/tdx_extended_servers.json +22 -0
- axdata_source_tdx/resources/tdx_quote_servers.json +49 -0
- axdata_source_tdx/security_codes.py +127 -0
- axdata_source_tdx/series_history.py +348 -0
- axdata_source_tdx/server_cache.py +21 -0
- axdata_source_tdx/snapshot_normalize.py +232 -0
- axdata_source_tdx/source_adapter_registry.py +42 -0
- axdata_source_tdx/source_execution.py +22 -0
- axdata_source_tdx/source_execution_registry.py +43 -0
- axdata_source_tdx/stats_cache.py +150 -0
- axdata_source_tdx/stats_models.py +161 -0
- axdata_source_tdx/stats_resource.py +242 -0
- axdata_source_tdx/status_fetch.py +209 -0
- axdata_source_tdx/tdx_f10_catalog.py +957 -0
- axdata_source_tdx/tdx_f10_models.py +47 -0
- axdata_source_tdx/tdx_f10_names.py +48 -0
- axdata_source_tdx/tdx_f10_specs.py +1142 -0
- axdata_source_tdx/tdx_server_config.py +389 -0
- axdata_source_tdx/time_series_normalize.py +370 -0
- axdata_source_tdx/tqlex.py +138 -0
- axdata_source_tdx/wire.py +32 -0
- axdata_source_tdx/wire_requests.py +190 -0
- axdata_source_tdx_ext/__init__.py +15 -0
- axdata_source_tdx_ext/adapter.py +31 -0
- axdata_source_tdx_ext/axdata-provider.json +9424 -0
- axdata_source_tdx_ext/catalog.py +33 -0
- axdata_source_tdx_ext/metadata.py +8 -0
- axdata_source_tdx_ext/provider.py +44 -0
- axdata_source_tencent/__init__.py +15 -0
- axdata_source_tencent/adapter.py +31 -0
- axdata_source_tencent/axdata-provider.json +291 -0
- axdata_source_tencent/catalog.py +190 -0
- axdata_source_tencent/metadata.py +8 -0
- axdata_source_tencent/provider.py +41 -0
axdata_core/__init__.py
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"""Core schemas, storage, querying, and quality checks for AxData.
|
|
2
|
+
|
|
3
|
+
The root package keeps the historical ``from axdata_core import ...`` exports,
|
|
4
|
+
but resolves them lazily so Provider packages can import narrow submodules such
|
|
5
|
+
as ``axdata_core.plugins`` without loading request routers, built-in providers,
|
|
6
|
+
or downloader machinery.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
from importlib import import_module
|
|
12
|
+
from typing import Any
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
_EXPORT_MODULES: dict[str, str] = {
|
|
16
|
+
"AxDataPaths": ".paths",
|
|
17
|
+
"DATA_LAYERS": ".paths",
|
|
18
|
+
"MANIFEST_FILE_NAME": ".plugins",
|
|
19
|
+
"MANIFEST_VERSION": ".plugins",
|
|
20
|
+
"PLUGIN_API_VERSION": ".plugins",
|
|
21
|
+
"AssetClass": ".plugins",
|
|
22
|
+
"CollectorSpec": ".plugins",
|
|
23
|
+
"ConfigSchema": ".plugins",
|
|
24
|
+
"DependencySpec": ".plugins",
|
|
25
|
+
"DownloaderMode": ".plugins",
|
|
26
|
+
"DownloaderProfile": ".plugins",
|
|
27
|
+
"FieldSpec": ".plugins",
|
|
28
|
+
"FieldType": ".plugins",
|
|
29
|
+
"InterfaceCollectionSpec": ".plugins",
|
|
30
|
+
"InterfaceSpec": ".plugins",
|
|
31
|
+
"ManifestError": ".plugins",
|
|
32
|
+
"ParameterSpec": ".plugins",
|
|
33
|
+
"ParameterType": ".plugins",
|
|
34
|
+
"PluginStatus": ".plugins",
|
|
35
|
+
"PluginTrustLevel": ".plugins",
|
|
36
|
+
"PluginInfo": ".plugins",
|
|
37
|
+
"PLUGIN_MANIFEST_FILE_NAME": ".plugins",
|
|
38
|
+
"ProviderInfo": ".plugins",
|
|
39
|
+
"ProviderManifest": ".plugins",
|
|
40
|
+
"RequiredConfig": ".plugins",
|
|
41
|
+
"RequestMode": ".plugins",
|
|
42
|
+
"SourceAdapter": ".plugins",
|
|
43
|
+
"SourceProvider": ".plugins",
|
|
44
|
+
"SourceResult": ".plugins",
|
|
45
|
+
"manifest_from_provider": ".plugins",
|
|
46
|
+
"validate_manifest": ".plugins",
|
|
47
|
+
"CollectorRegistry": ".collector_registry",
|
|
48
|
+
"CollectorRegistration": ".collector_registry",
|
|
49
|
+
"CollectorRegistrySnapshot": ".collector_registry",
|
|
50
|
+
"RegisteredCollectorPlugin": ".collector_registry",
|
|
51
|
+
"build_collector_registry": ".collector_registry",
|
|
52
|
+
"InterfaceRegistration": ".provider_registry",
|
|
53
|
+
"ProviderRegistry": ".provider_registry",
|
|
54
|
+
"ProviderRegistrySnapshot": ".provider_registry",
|
|
55
|
+
"RegisteredProvider": ".provider_registry",
|
|
56
|
+
"build_builtin_provider_registry": ".provider_catalog",
|
|
57
|
+
"list_registry_collector_dicts": ".provider_catalog",
|
|
58
|
+
"list_registry_interface_dicts": ".provider_catalog",
|
|
59
|
+
"EXPECTED_OPTIONAL_PROVIDERS": ".plugin_status",
|
|
60
|
+
"TDX_EXT_PROVIDER_ID": ".plugin_status",
|
|
61
|
+
"TDX_PROVIDER_ID": ".plugin_status",
|
|
62
|
+
"expected_provider_statuses": ".plugin_status",
|
|
63
|
+
"install_source_for_provider": ".plugin_status",
|
|
64
|
+
"managed_provider_ids": ".plugin_status",
|
|
65
|
+
"provider_kind_for_provider": ".plugin_status",
|
|
66
|
+
"provider_management_fields": ".plugin_status",
|
|
67
|
+
"provider_status_row": ".plugin_status",
|
|
68
|
+
"uninstall_mode_for_source": ".plugin_status",
|
|
69
|
+
"uninstall_block_reason_for_source": ".plugin_status",
|
|
70
|
+
"PLUGIN_CONFIG_FILE_NAME": ".plugin_config",
|
|
71
|
+
"PLUGIN_CONFIG_VERSION": ".plugin_config",
|
|
72
|
+
"PluginConfig": ".plugin_config",
|
|
73
|
+
"PluginConfigError": ".plugin_config",
|
|
74
|
+
"disable_provider": ".plugin_config",
|
|
75
|
+
"enable_provider": ".plugin_config",
|
|
76
|
+
"load_plugin_config": ".plugin_config",
|
|
77
|
+
"plugin_config_path": ".plugin_config",
|
|
78
|
+
"remove_provider": ".plugin_config",
|
|
79
|
+
"save_plugin_config": ".plugin_config",
|
|
80
|
+
"set_provider_override": ".plugin_config",
|
|
81
|
+
"CollectorError": ".collector_runner",
|
|
82
|
+
"CollectorRunPlan": ".collector_runner",
|
|
83
|
+
"CollectorRunRequest": ".collector_runner",
|
|
84
|
+
"build_collector_run_plan": ".collector_runner",
|
|
85
|
+
"run_collector": ".collector_runner",
|
|
86
|
+
"ACTIVE_RUN_STATUSES": ".collector_scheduler",
|
|
87
|
+
"COLLECTOR_SCHEDULER_FILE_NAME": ".collector_scheduler",
|
|
88
|
+
"FINAL_RUN_STATUSES": ".collector_scheduler",
|
|
89
|
+
"SCHEDULER_STORE_VERSION": ".collector_scheduler",
|
|
90
|
+
"CollectorRun": ".collector_scheduler",
|
|
91
|
+
"CollectorSchedulerError": ".collector_scheduler",
|
|
92
|
+
"CollectorSchedulerService": ".collector_scheduler",
|
|
93
|
+
"CollectorSchedulerStore": ".collector_scheduler",
|
|
94
|
+
"CollectorTask": ".collector_scheduler",
|
|
95
|
+
"TaskStatus": ".collector_scheduler",
|
|
96
|
+
"TriggerType": ".collector_scheduler",
|
|
97
|
+
"collector_run_signature": ".collector_scheduler",
|
|
98
|
+
"collector_scheduler_store_path": ".collector_scheduler",
|
|
99
|
+
"collector_run_guidance": ".collector_scheduler",
|
|
100
|
+
"collector_task_guidance": ".collector_scheduler",
|
|
101
|
+
"compute_next_run_at": ".collector_scheduler",
|
|
102
|
+
"create_collector_task": ".collector_scheduler",
|
|
103
|
+
"create_run_from_task": ".collector_scheduler",
|
|
104
|
+
"normalize_date_range": ".collector_scheduler",
|
|
105
|
+
"refresh_task_dependency_status": ".collector_scheduler",
|
|
106
|
+
"seed_default_collector_tasks": ".collector_scheduler",
|
|
107
|
+
"task_run_kwargs": ".collector_scheduler",
|
|
108
|
+
"CollectorTemplateError": ".collector_templates",
|
|
109
|
+
"DEFAULT_TASK_TEMPLATE_IDS": ".collector_templates",
|
|
110
|
+
"TaskTemplate": ".collector_templates",
|
|
111
|
+
"default_task_templates": ".collector_templates",
|
|
112
|
+
"default_task_to_create_kwargs": ".collector_templates",
|
|
113
|
+
"get_task_template": ".collector_templates",
|
|
114
|
+
"list_task_templates": ".collector_templates",
|
|
115
|
+
"task_template_to_create_kwargs": ".collector_templates",
|
|
116
|
+
"DefaultRequestPlanner": ".downloader_engine",
|
|
117
|
+
"DownloadMetadataWriter": ".downloader_engine",
|
|
118
|
+
"DownloadQualityChecker": ".downloader_engine",
|
|
119
|
+
"DownloadWriter": ".downloader_engine",
|
|
120
|
+
"DataBrowserError": ".data_browser",
|
|
121
|
+
"DataPreview": ".data_browser",
|
|
122
|
+
"DatasetSummary": ".data_browser",
|
|
123
|
+
"clamp_limit": ".data_browser",
|
|
124
|
+
"delete_dataset": ".data_browser",
|
|
125
|
+
"get_dataset": ".data_browser",
|
|
126
|
+
"list_datasets": ".data_browser",
|
|
127
|
+
"preview_dataset": ".data_browser",
|
|
128
|
+
"AXP_CHECKSUMS_FILE_NAME": ".axp",
|
|
129
|
+
"AXP_MANIFEST_FILE_NAME": ".axp",
|
|
130
|
+
"AXP_SITE_PACKAGES_DIR_NAME": ".axp",
|
|
131
|
+
"AxpAlreadyInstalledError": ".axp",
|
|
132
|
+
"AxpDependencyStatus": ".axp",
|
|
133
|
+
"AxpError": ".axp",
|
|
134
|
+
"AxpInstalledPlugin": ".axp",
|
|
135
|
+
"AxpInstallResult": ".axp",
|
|
136
|
+
"AxpPreview": ".axp",
|
|
137
|
+
"AxpUninstallError": ".axp",
|
|
138
|
+
"AxpUninstallResult": ".axp",
|
|
139
|
+
"AxpWheelInfo": ".axp",
|
|
140
|
+
"axp_plugin_site_packages": ".axp",
|
|
141
|
+
"AxpExportResult": ".axp",
|
|
142
|
+
"export_axp_plugin": ".axp",
|
|
143
|
+
"install_axp": ".axp",
|
|
144
|
+
"list_installed_axp_plugins": ".axp",
|
|
145
|
+
"preview_axp": ".axp",
|
|
146
|
+
"uninstall_axp_plugin": ".axp",
|
|
147
|
+
"BuiltinSourceAdapter": ".builtin_providers",
|
|
148
|
+
"BuiltinSourceProvider": ".builtin_providers",
|
|
149
|
+
"get_builtin_provider": ".builtin_providers",
|
|
150
|
+
"list_builtin_providers": ".builtin_providers",
|
|
151
|
+
"QualityIssue": ".quality",
|
|
152
|
+
"check_missing_required": ".quality",
|
|
153
|
+
"check_primary_key_duplicates": ".quality",
|
|
154
|
+
"validate_table": ".quality",
|
|
155
|
+
"query_table": ".query",
|
|
156
|
+
"Field": ".schema",
|
|
157
|
+
"TableSchema": ".schema",
|
|
158
|
+
"get_schema": ".schema",
|
|
159
|
+
"list_tables": ".schema",
|
|
160
|
+
"normalize_table_name": ".schema",
|
|
161
|
+
"SourceAdapterError": ".source_errors",
|
|
162
|
+
"SourceAdapterNotFound": ".source_errors",
|
|
163
|
+
"SourceInterfaceNotFound": ".source_errors",
|
|
164
|
+
"SourceRequestError": ".source_errors",
|
|
165
|
+
"SourceRequestResult": ".source_request",
|
|
166
|
+
"SourceRequestValidationError": ".source_errors",
|
|
167
|
+
"SourceUnavailableError": ".source_errors",
|
|
168
|
+
"LocalSourceSession": ".source_session",
|
|
169
|
+
"SessionSourceRequestAdapter": ".source_session",
|
|
170
|
+
"SUPPORTED_SESSION_SOURCES": ".source_session",
|
|
171
|
+
"create_source_session": ".source_session",
|
|
172
|
+
"request_interface": ".source_request",
|
|
173
|
+
"DownloadRequestPlan": ".downloader_engine",
|
|
174
|
+
"DownloaderError": ".downloaders",
|
|
175
|
+
"build_request_plan": ".downloaders",
|
|
176
|
+
"get_downloader_profile": ".downloaders",
|
|
177
|
+
"list_downloader_profiles": ".downloaders",
|
|
178
|
+
"run_downloader": ".downloaders",
|
|
179
|
+
"TradeCalendarCacheError": ".trade_calendar_cache",
|
|
180
|
+
"check_trade_calendar_cache": ".trade_calendar_cache",
|
|
181
|
+
"ensure_trade_calendar_cache": ".trade_calendar_cache",
|
|
182
|
+
"get_trade_calendar_cache_status": ".trade_calendar_cache",
|
|
183
|
+
"refresh_trade_calendar_cache": ".trade_calendar_cache",
|
|
184
|
+
"trade_calendar_cache_path": ".trade_calendar_cache",
|
|
185
|
+
"update_trade_calendar_cache_from_records": ".trade_calendar_cache",
|
|
186
|
+
"core_table_duckdb_path": ".storage",
|
|
187
|
+
"core_table_partition_path": ".storage",
|
|
188
|
+
"core_table_path": ".storage",
|
|
189
|
+
"core_table_read_path": ".storage",
|
|
190
|
+
"read_core_table": ".storage",
|
|
191
|
+
"write_core_table": ".storage",
|
|
192
|
+
"build_local_diagnostics": ".diagnostics",
|
|
193
|
+
"initialize_local_environment": ".diagnostics",
|
|
194
|
+
"local_config": ".diagnostics",
|
|
195
|
+
"provider_guidance": ".diagnostics",
|
|
196
|
+
"resolve_data_root": ".diagnostics",
|
|
197
|
+
"RequestExample": ".sources",
|
|
198
|
+
"RequestField": ".sources",
|
|
199
|
+
"RequestParameter": ".sources",
|
|
200
|
+
"SourceRequestInterface": ".sources",
|
|
201
|
+
"get_request_interface": ".sources",
|
|
202
|
+
"list_request_interface_dicts": ".sources",
|
|
203
|
+
"list_request_interface_names": ".sources",
|
|
204
|
+
"list_request_interfaces": ".sources",
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
__all__ = sorted(_EXPORT_MODULES)
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
def __getattr__(name: str) -> Any:
|
|
211
|
+
module_name = _EXPORT_MODULES.get(name)
|
|
212
|
+
if module_name is None:
|
|
213
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
214
|
+
module = import_module(module_name, __name__)
|
|
215
|
+
value = getattr(module, name)
|
|
216
|
+
globals()[name] = value
|
|
217
|
+
return value
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
def __dir__() -> list[str]:
|
|
221
|
+
return sorted({*globals(), *__all__})
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"""Compatibility shim for ``axdata_core._tdx_wire``.
|
|
2
|
+
|
|
3
|
+
The provider-owned TDX wire implementation lives in ``axdata_source_tdx._tdx_wire``.
|
|
4
|
+
This module keeps old imports working when the TDX plugin is installed and
|
|
5
|
+
enabled. Core no longer contains a runnable TDX wire fallback.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from ._shim import load_provider_first
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
_CLIENT_EXPORTS = {"Client", "TdxClient"}
|
|
14
|
+
_PROVIDER_CLIENT_MODULE = "axdata_source_tdx._tdx_wire.client"
|
|
15
|
+
|
|
16
|
+
__all__ = [
|
|
17
|
+
"Client",
|
|
18
|
+
"TdxClient",
|
|
19
|
+
"__version__",
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
__version__ = "0.1.0"
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def __getattr__(name: str):
|
|
26
|
+
if name in _CLIENT_EXPORTS:
|
|
27
|
+
implementation = load_provider_first(_PROVIDER_CLIENT_MODULE)
|
|
28
|
+
value = getattr(implementation, name)
|
|
29
|
+
globals()[name] = value
|
|
30
|
+
return value
|
|
31
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def __dir__() -> list[str]:
|
|
35
|
+
return sorted(set(globals()) | set(__all__))
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"""Shared provider-only shim helpers for legacy core TDX wire imports."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from importlib import import_module
|
|
6
|
+
from types import ModuleType
|
|
7
|
+
from typing import Any
|
|
8
|
+
|
|
9
|
+
from axdata_core.tdx_plugin_required import TDX_PLUGIN_REQUIRED_MESSAGE
|
|
10
|
+
from axdata_core.source_errors import SourceUnavailableError
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _is_missing_tdx_provider(exc: ModuleNotFoundError, provider_module: str) -> bool:
|
|
14
|
+
missing_name = str(exc.name)
|
|
15
|
+
return exc.name in {"axdata_source_tdx", provider_module} or missing_name.startswith("axdata_source_tdx.")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def load_provider_module(provider_module: str) -> ModuleType:
|
|
19
|
+
"""Load the provider-owned wire module or raise a clear plugin error."""
|
|
20
|
+
|
|
21
|
+
try:
|
|
22
|
+
return import_module(provider_module)
|
|
23
|
+
except ModuleNotFoundError as exc:
|
|
24
|
+
if _is_missing_tdx_provider(exc, provider_module):
|
|
25
|
+
raise SourceUnavailableError(TDX_PLUGIN_REQUIRED_MESSAGE) from exc
|
|
26
|
+
raise
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def load_provider_module_cached(
|
|
30
|
+
module_globals: dict[str, Any],
|
|
31
|
+
cache_name: str,
|
|
32
|
+
provider_module: str,
|
|
33
|
+
) -> ModuleType:
|
|
34
|
+
"""Load and cache a provider-owned implementation inside a shim module."""
|
|
35
|
+
|
|
36
|
+
implementation = module_globals.get(cache_name)
|
|
37
|
+
if implementation is None:
|
|
38
|
+
implementation = load_provider_module(provider_module)
|
|
39
|
+
module_globals[cache_name] = implementation
|
|
40
|
+
return implementation
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def install_provider_module(
|
|
44
|
+
module_globals: dict[str, Any],
|
|
45
|
+
*,
|
|
46
|
+
provider_module: str,
|
|
47
|
+
) -> ModuleType:
|
|
48
|
+
"""Populate a legacy shim module from its provider-owned implementation."""
|
|
49
|
+
|
|
50
|
+
implementation = load_provider_module(provider_module)
|
|
51
|
+
exports = list(getattr(implementation, "__all__", [name for name in dir(implementation) if not name.startswith("_")]))
|
|
52
|
+
|
|
53
|
+
module_globals["_impl"] = implementation
|
|
54
|
+
module_globals["__all__"] = exports
|
|
55
|
+
for name in exports:
|
|
56
|
+
module_globals[name] = getattr(implementation, name)
|
|
57
|
+
|
|
58
|
+
def __getattr__(name: str) -> Any:
|
|
59
|
+
return getattr(implementation, name)
|
|
60
|
+
|
|
61
|
+
def __dir__() -> list[str]:
|
|
62
|
+
return sorted(set(module_globals) | set(dir(implementation)))
|
|
63
|
+
|
|
64
|
+
module_globals["__getattr__"] = __getattr__
|
|
65
|
+
module_globals["__dir__"] = __dir__
|
|
66
|
+
return implementation
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def install_lazy_provider_module(
|
|
70
|
+
module_globals: dict[str, Any],
|
|
71
|
+
*,
|
|
72
|
+
provider_module: str,
|
|
73
|
+
exports: list[str],
|
|
74
|
+
) -> None:
|
|
75
|
+
"""Install a provider-owned shim that loads the implementation on demand."""
|
|
76
|
+
|
|
77
|
+
export_names = list(exports)
|
|
78
|
+
module_globals["_impl"] = None
|
|
79
|
+
module_globals["__all__"] = export_names
|
|
80
|
+
|
|
81
|
+
def _load_impl() -> ModuleType:
|
|
82
|
+
implementation = module_globals.get("_impl")
|
|
83
|
+
if implementation is None:
|
|
84
|
+
implementation = load_provider_module(provider_module)
|
|
85
|
+
module_globals["_impl"] = implementation
|
|
86
|
+
return implementation
|
|
87
|
+
|
|
88
|
+
def __getattr__(name: str) -> Any:
|
|
89
|
+
if name.startswith("__") and name.endswith("__"):
|
|
90
|
+
raise AttributeError(f"module {module_globals.get('__name__')!r} has no attribute {name!r}")
|
|
91
|
+
value = getattr(_load_impl(), name)
|
|
92
|
+
if name in export_names:
|
|
93
|
+
module_globals[name] = value
|
|
94
|
+
return value
|
|
95
|
+
|
|
96
|
+
def __dir__() -> list[str]:
|
|
97
|
+
implementation = module_globals.get("_impl")
|
|
98
|
+
names = set(module_globals) | set(export_names)
|
|
99
|
+
if implementation is not None:
|
|
100
|
+
names |= set(dir(implementation))
|
|
101
|
+
return sorted(names)
|
|
102
|
+
|
|
103
|
+
module_globals["_load_impl"] = _load_impl
|
|
104
|
+
module_globals["__getattr__"] = __getattr__
|
|
105
|
+
module_globals["__dir__"] = __dir__
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
# Backward-compatible helper names for existing shim modules. The fallback
|
|
109
|
+
# argument is accepted but ignored; core no longer contains a runnable TDX wire
|
|
110
|
+
# fallback.
|
|
111
|
+
def load_provider_first(provider_module: str, fallback_module: str | None = None) -> ModuleType:
|
|
112
|
+
return load_provider_module(provider_module)
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
def load_provider_first_cached(
|
|
116
|
+
module_globals: dict[str, Any],
|
|
117
|
+
cache_name: str,
|
|
118
|
+
provider_module: str,
|
|
119
|
+
fallback_module: str | None = None,
|
|
120
|
+
) -> ModuleType:
|
|
121
|
+
return load_provider_module_cached(module_globals, cache_name, provider_module)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def install_provider_first(
|
|
125
|
+
module_globals: dict[str, Any],
|
|
126
|
+
*,
|
|
127
|
+
provider_module: str,
|
|
128
|
+
fallback_module: str | None = None,
|
|
129
|
+
) -> ModuleType:
|
|
130
|
+
return install_provider_module(module_globals, provider_module=provider_module)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def install_lazy_provider_first(
|
|
134
|
+
module_globals: dict[str, Any],
|
|
135
|
+
*,
|
|
136
|
+
provider_module: str,
|
|
137
|
+
fallback_module: str | None = None,
|
|
138
|
+
exports: list[str],
|
|
139
|
+
) -> None:
|
|
140
|
+
install_lazy_provider_module(module_globals, provider_module=provider_module, exports=exports)
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"""Compatibility shim for axdata_core._tdx_wire.api.
|
|
2
|
+
|
|
3
|
+
The provider-owned TDX wire implementation lives in ``axdata_source_tdx._tdx_wire``.
|
|
4
|
+
This module keeps old imports working by loading the TDX plugin on demand.
|
|
5
|
+
If the plugin is unavailable, attribute access raises a clear install/enable error.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from .._shim import load_provider_first
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
_EXPORT_MODULES = {
|
|
14
|
+
"AuctionApi": "axdata_source_tdx._tdx_wire.api.auction",
|
|
15
|
+
"BarApi": "axdata_source_tdx._tdx_wire.api.bars",
|
|
16
|
+
"CodeApi": "axdata_source_tdx._tdx_wire.api.codes",
|
|
17
|
+
"CorporateApi": "axdata_source_tdx._tdx_wire.api.corporate",
|
|
18
|
+
"FinanceApi": "axdata_source_tdx._tdx_wire.api.finance",
|
|
19
|
+
"IntradayApi": "axdata_source_tdx._tdx_wire.api.intraday",
|
|
20
|
+
"QuoteApi": "axdata_source_tdx._tdx_wire.api.quotes",
|
|
21
|
+
"ResourceApi": "axdata_source_tdx._tdx_wire.api.resources",
|
|
22
|
+
"SessionApi": "axdata_source_tdx._tdx_wire.api.session",
|
|
23
|
+
"TradeApi": "axdata_source_tdx._tdx_wire.api.trades",
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
__all__ = [
|
|
27
|
+
"AuctionApi",
|
|
28
|
+
"BarApi",
|
|
29
|
+
"CodeApi",
|
|
30
|
+
"CorporateApi",
|
|
31
|
+
"FinanceApi",
|
|
32
|
+
"IntradayApi",
|
|
33
|
+
"QuoteApi",
|
|
34
|
+
"ResourceApi",
|
|
35
|
+
"SessionApi",
|
|
36
|
+
"TradeApi",
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def __getattr__(name: str):
|
|
41
|
+
module_name = _EXPORT_MODULES.get(name)
|
|
42
|
+
if module_name is None:
|
|
43
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
44
|
+
implementation = load_provider_first(module_name)
|
|
45
|
+
value = getattr(implementation, name)
|
|
46
|
+
globals()[name] = value
|
|
47
|
+
return value
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def __dir__() -> list[str]:
|
|
51
|
+
return sorted(set(globals()) | set(__all__))
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"""Compatibility shim for axdata_core._tdx_wire.api.auction.
|
|
2
|
+
|
|
3
|
+
The provider-owned TDX wire implementation lives in ``axdata_source_tdx._tdx_wire``.
|
|
4
|
+
This module keeps old imports working by loading the TDX plugin on demand.
|
|
5
|
+
If the plugin is unavailable, attribute access raises a clear install/enable error.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from .._shim import install_lazy_provider_first
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
_PROVIDER_MODULE = "axdata_source_tdx._tdx_wire.api.auction"
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
install_lazy_provider_first(
|
|
17
|
+
globals(),
|
|
18
|
+
provider_module=_PROVIDER_MODULE,
|
|
19
|
+
exports=[
|
|
20
|
+
'ApiBase',
|
|
21
|
+
'AuctionApi',
|
|
22
|
+
'annotations',
|
|
23
|
+
],
|
|
24
|
+
)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"""Compatibility shim for axdata_core._tdx_wire.api.bars.
|
|
2
|
+
|
|
3
|
+
The provider-owned TDX wire implementation lives in ``axdata_source_tdx._tdx_wire``.
|
|
4
|
+
This module keeps old imports working by loading the TDX plugin on demand.
|
|
5
|
+
If the plugin is unavailable, attribute access raises a clear install/enable error.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from .._shim import install_lazy_provider_first
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
_PROVIDER_MODULE = "axdata_source_tdx._tdx_wire.api.bars"
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
install_lazy_provider_first(
|
|
17
|
+
globals(),
|
|
18
|
+
provider_module=_PROVIDER_MODULE,
|
|
19
|
+
exports=[
|
|
20
|
+
'ApiBase',
|
|
21
|
+
'BarApi',
|
|
22
|
+
'annotations',
|
|
23
|
+
],
|
|
24
|
+
)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""Compatibility shim for axdata_core._tdx_wire.api.base.
|
|
2
|
+
|
|
3
|
+
The provider-owned TDX wire implementation lives in ``axdata_source_tdx._tdx_wire``.
|
|
4
|
+
This module keeps old imports working by loading the TDX plugin on demand.
|
|
5
|
+
If the plugin is unavailable, attribute access raises a clear install/enable error.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from .._shim import install_lazy_provider_first
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
_PROVIDER_MODULE = "axdata_source_tdx._tdx_wire.api.base"
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
install_lazy_provider_first(
|
|
17
|
+
globals(),
|
|
18
|
+
provider_module=_PROVIDER_MODULE,
|
|
19
|
+
exports=[
|
|
20
|
+
'Any',
|
|
21
|
+
'ApiBase',
|
|
22
|
+
'COMMAND_CODES',
|
|
23
|
+
'TYPE_CHECKING',
|
|
24
|
+
'annotations',
|
|
25
|
+
],
|
|
26
|
+
)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""Compatibility shim for axdata_core._tdx_wire.api.codes.
|
|
2
|
+
|
|
3
|
+
The provider-owned TDX wire implementation lives in ``axdata_source_tdx._tdx_wire``.
|
|
4
|
+
This module keeps old imports working by loading the TDX plugin on demand.
|
|
5
|
+
If the plugin is unavailable, attribute access raises a clear install/enable error.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from .._shim import install_lazy_provider_first
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
_PROVIDER_MODULE = "axdata_source_tdx._tdx_wire.api.codes"
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
install_lazy_provider_first(
|
|
17
|
+
globals(),
|
|
18
|
+
provider_module=_PROVIDER_MODULE,
|
|
19
|
+
exports=[
|
|
20
|
+
'ApiBase',
|
|
21
|
+
'CodeApi',
|
|
22
|
+
'DEFAULT_CODE_PAGE_SIZE',
|
|
23
|
+
'annotations',
|
|
24
|
+
],
|
|
25
|
+
)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"""Compatibility shim for axdata_core._tdx_wire.api.corporate.
|
|
2
|
+
|
|
3
|
+
The provider-owned TDX wire implementation lives in ``axdata_source_tdx._tdx_wire``.
|
|
4
|
+
This module keeps old imports working by loading the TDX plugin on demand.
|
|
5
|
+
If the plugin is unavailable, attribute access raises a clear install/enable error.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from .._shim import install_lazy_provider_first
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
_PROVIDER_MODULE = "axdata_source_tdx._tdx_wire.api.corporate"
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
install_lazy_provider_first(
|
|
17
|
+
globals(),
|
|
18
|
+
provider_module=_PROVIDER_MODULE,
|
|
19
|
+
exports=[
|
|
20
|
+
'ApiBase',
|
|
21
|
+
'CorporateApi',
|
|
22
|
+
'annotations',
|
|
23
|
+
],
|
|
24
|
+
)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"""Compatibility shim for axdata_core._tdx_wire.api.finance.
|
|
2
|
+
|
|
3
|
+
The provider-owned TDX wire implementation lives in ``axdata_source_tdx._tdx_wire``.
|
|
4
|
+
This module keeps old imports working by loading the TDX plugin on demand.
|
|
5
|
+
If the plugin is unavailable, attribute access raises a clear install/enable error.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from .._shim import install_lazy_provider_first
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
_PROVIDER_MODULE = "axdata_source_tdx._tdx_wire.api.finance"
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
install_lazy_provider_first(
|
|
17
|
+
globals(),
|
|
18
|
+
provider_module=_PROVIDER_MODULE,
|
|
19
|
+
exports=[
|
|
20
|
+
'ApiBase',
|
|
21
|
+
'FinanceApi',
|
|
22
|
+
'annotations',
|
|
23
|
+
],
|
|
24
|
+
)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"""Compatibility shim for axdata_core._tdx_wire.api.intraday.
|
|
2
|
+
|
|
3
|
+
The provider-owned TDX wire implementation lives in ``axdata_source_tdx._tdx_wire``.
|
|
4
|
+
This module keeps old imports working by loading the TDX plugin on demand.
|
|
5
|
+
If the plugin is unavailable, attribute access raises a clear install/enable error.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from .._shim import install_lazy_provider_first
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
_PROVIDER_MODULE = "axdata_source_tdx._tdx_wire.api.intraday"
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
install_lazy_provider_first(
|
|
17
|
+
globals(),
|
|
18
|
+
provider_module=_PROVIDER_MODULE,
|
|
19
|
+
exports=[
|
|
20
|
+
'ApiBase',
|
|
21
|
+
'IntradayApi',
|
|
22
|
+
'annotations',
|
|
23
|
+
],
|
|
24
|
+
)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""Compatibility shim for axdata_core._tdx_wire.api.quotes.
|
|
2
|
+
|
|
3
|
+
The provider-owned TDX wire implementation lives in ``axdata_source_tdx._tdx_wire``.
|
|
4
|
+
This module keeps old imports working by loading the TDX plugin on demand.
|
|
5
|
+
If the plugin is unavailable, attribute access raises a clear install/enable error.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from .._shim import install_lazy_provider_first
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
_PROVIDER_MODULE = "axdata_source_tdx._tdx_wire.api.quotes"
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
install_lazy_provider_first(
|
|
17
|
+
globals(),
|
|
18
|
+
provider_module=_PROVIDER_MODULE,
|
|
19
|
+
exports=[
|
|
20
|
+
'ApiBase',
|
|
21
|
+
'DEFAULT_QUOTE_BATCH_SIZE',
|
|
22
|
+
'QuoteApi',
|
|
23
|
+
'Sequence',
|
|
24
|
+
'annotations',
|
|
25
|
+
],
|
|
26
|
+
)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""Compatibility shim for axdata_core._tdx_wire.api.resources.
|
|
2
|
+
|
|
3
|
+
The provider-owned TDX wire implementation lives in ``axdata_source_tdx._tdx_wire``.
|
|
4
|
+
This module keeps old imports working by loading the TDX plugin on demand.
|
|
5
|
+
If the plugin is unavailable, attribute access raises a clear install/enable error.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from .._shim import install_lazy_provider_first
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
_PROVIDER_MODULE = "axdata_source_tdx._tdx_wire.api.resources"
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
install_lazy_provider_first(
|
|
17
|
+
globals(),
|
|
18
|
+
provider_module=_PROVIDER_MODULE,
|
|
19
|
+
exports=[
|
|
20
|
+
'ApiBase',
|
|
21
|
+
'DEFAULT_FILE_CHUNK_SIZE',
|
|
22
|
+
'ResourceApi',
|
|
23
|
+
'annotations',
|
|
24
|
+
],
|
|
25
|
+
)
|