axdata 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- axdata-0.1.0/LICENSE +162 -0
- axdata-0.1.0/PKG-INFO +238 -0
- axdata-0.1.0/README.md +210 -0
- axdata-0.1.0/axdata/__init__.py +16 -0
- axdata-0.1.0/axdata/cache.py +19 -0
- axdata-0.1.0/axdata/client.py +1223 -0
- axdata-0.1.0/axdata.egg-info/PKG-INFO +238 -0
- axdata-0.1.0/axdata.egg-info/SOURCES.txt +430 -0
- axdata-0.1.0/axdata.egg-info/dependency_links.txt +1 -0
- axdata-0.1.0/axdata.egg-info/entry_points.txt +8 -0
- axdata-0.1.0/axdata.egg-info/requires.txt +11 -0
- axdata-0.1.0/axdata.egg-info/top_level.txt +6 -0
- axdata-0.1.0/axdata_core/__init__.py +221 -0
- axdata-0.1.0/axdata_core/_tdx_wire/__init__.py +35 -0
- axdata-0.1.0/axdata_core/_tdx_wire/_shim.py +140 -0
- axdata-0.1.0/axdata_core/_tdx_wire/api/__init__.py +51 -0
- axdata-0.1.0/axdata_core/_tdx_wire/api/auction.py +24 -0
- axdata-0.1.0/axdata_core/_tdx_wire/api/bars.py +24 -0
- axdata-0.1.0/axdata_core/_tdx_wire/api/base.py +26 -0
- axdata-0.1.0/axdata_core/_tdx_wire/api/codes.py +25 -0
- axdata-0.1.0/axdata_core/_tdx_wire/api/corporate.py +24 -0
- axdata-0.1.0/axdata_core/_tdx_wire/api/finance.py +24 -0
- axdata-0.1.0/axdata_core/_tdx_wire/api/intraday.py +24 -0
- axdata-0.1.0/axdata_core/_tdx_wire/api/quotes.py +26 -0
- axdata-0.1.0/axdata_core/_tdx_wire/api/resources.py +25 -0
- axdata-0.1.0/axdata_core/_tdx_wire/api/session.py +24 -0
- axdata-0.1.0/axdata_core/_tdx_wire/api/trades.py +24 -0
- axdata-0.1.0/axdata_core/_tdx_wire/client.py +33 -0
- axdata-0.1.0/axdata_core/_tdx_wire/exceptions.py +27 -0
- axdata-0.1.0/axdata_core/_tdx_wire/hosts.py +106 -0
- axdata-0.1.0/axdata_core/_tdx_wire/models/__init__.py +93 -0
- axdata-0.1.0/axdata_core/_tdx_wire/models/auction.py +26 -0
- axdata-0.1.0/axdata_core/_tdx_wire/models/corporate.py +27 -0
- axdata-0.1.0/axdata_core/_tdx_wire/models/finance.py +26 -0
- axdata-0.1.0/axdata_core/_tdx_wire/models/intraday.py +31 -0
- axdata-0.1.0/axdata_core/_tdx_wire/models/kline.py +27 -0
- axdata-0.1.0/axdata_core/_tdx_wire/models/quote.py +32 -0
- axdata-0.1.0/axdata_core/_tdx_wire/models/resource.py +24 -0
- axdata-0.1.0/axdata_core/_tdx_wire/models/security.py +24 -0
- axdata-0.1.0/axdata_core/_tdx_wire/models/session.py +27 -0
- axdata-0.1.0/axdata_core/_tdx_wire/models/subchart.py +25 -0
- axdata-0.1.0/axdata_core/_tdx_wire/models/trade.py +28 -0
- axdata-0.1.0/axdata_core/_tdx_wire/protocol/__init__.py +49 -0
- axdata-0.1.0/axdata_core/_tdx_wire/protocol/commands/__init__.py +43 -0
- axdata-0.1.0/axdata_core/_tdx_wire/protocol/commands/auction.py +110 -0
- axdata-0.1.0/axdata_core/_tdx_wire/protocol/commands/codec.py +43 -0
- axdata-0.1.0/axdata_core/_tdx_wire/protocol/commands/corporate.py +98 -0
- axdata-0.1.0/axdata_core/_tdx_wire/protocol/commands/finance.py +96 -0
- axdata-0.1.0/axdata_core/_tdx_wire/protocol/commands/intraday.py +122 -0
- axdata-0.1.0/axdata_core/_tdx_wire/protocol/commands/klines.py +102 -0
- axdata-0.1.0/axdata_core/_tdx_wire/protocol/commands/lookup.py +36 -0
- axdata-0.1.0/axdata_core/_tdx_wire/protocol/commands/price_limits.py +89 -0
- axdata-0.1.0/axdata_core/_tdx_wire/protocol/commands/quotes.py +102 -0
- axdata-0.1.0/axdata_core/_tdx_wire/protocol/commands/registry.py +36 -0
- axdata-0.1.0/axdata_core/_tdx_wire/protocol/commands/resources.py +99 -0
- axdata-0.1.0/axdata_core/_tdx_wire/protocol/commands/security.py +103 -0
- axdata-0.1.0/axdata_core/_tdx_wire/protocol/commands/session.py +82 -0
- axdata-0.1.0/axdata_core/_tdx_wire/protocol/commands/subchart.py +97 -0
- axdata-0.1.0/axdata_core/_tdx_wire/protocol/commands/trades.py +107 -0
- axdata-0.1.0/axdata_core/_tdx_wire/protocol/constants.py +124 -0
- axdata-0.1.0/axdata_core/_tdx_wire/protocol/frame.py +68 -0
- axdata-0.1.0/axdata_core/_tdx_wire/protocol/unit.py +85 -0
- axdata-0.1.0/axdata_core/_tdx_wire/py.typed +1 -0
- axdata-0.1.0/axdata_core/_tdx_wire/transport/__init__.py +34 -0
- axdata-0.1.0/axdata_core/_tdx_wire/transport/base.py +25 -0
- axdata-0.1.0/axdata_core/_tdx_wire/transport/memory.py +24 -0
- axdata-0.1.0/axdata_core/_tdx_wire/transport/pool.py +32 -0
- axdata-0.1.0/axdata_core/_tdx_wire/transport/socket.py +39 -0
- axdata-0.1.0/axdata_core/adapters/__init__.py +0 -0
- axdata-0.1.0/axdata_core/adapters/cls/__init__.py +17 -0
- axdata-0.1.0/axdata_core/adapters/cls/provider_bridge.py +23 -0
- axdata-0.1.0/axdata_core/adapters/cls/request.py +632 -0
- axdata-0.1.0/axdata_core/adapters/cls/source_adapter_registry.py +31 -0
- axdata-0.1.0/axdata_core/adapters/cninfo/__init__.py +17 -0
- axdata-0.1.0/axdata_core/adapters/cninfo/provider_bridge.py +25 -0
- axdata-0.1.0/axdata_core/adapters/cninfo/request.py +2425 -0
- axdata-0.1.0/axdata_core/adapters/cninfo/source_adapter_registry.py +42 -0
- axdata-0.1.0/axdata_core/adapters/eastmoney/__init__.py +17 -0
- axdata-0.1.0/axdata_core/adapters/eastmoney/provider_bridge.py +25 -0
- axdata-0.1.0/axdata_core/adapters/eastmoney/request.py +1128 -0
- axdata-0.1.0/axdata_core/adapters/eastmoney/source_adapter_registry.py +42 -0
- axdata-0.1.0/axdata_core/adapters/exchange/__init__.py +17 -0
- axdata-0.1.0/axdata_core/adapters/exchange/provider_bridge.py +25 -0
- axdata-0.1.0/axdata_core/adapters/exchange/request.py +1214 -0
- axdata-0.1.0/axdata_core/adapters/exchange/source_adapter_registry.py +42 -0
- axdata-0.1.0/axdata_core/adapters/kph/__init__.py +17 -0
- axdata-0.1.0/axdata_core/adapters/kph/provider_bridge.py +23 -0
- axdata-0.1.0/axdata_core/adapters/kph/request.py +509 -0
- axdata-0.1.0/axdata_core/adapters/kph/source_adapter_registry.py +31 -0
- axdata-0.1.0/axdata_core/adapters/sina/__init__.py +17 -0
- axdata-0.1.0/axdata_core/adapters/sina/provider_bridge.py +25 -0
- axdata-0.1.0/axdata_core/adapters/sina/request.py +5155 -0
- axdata-0.1.0/axdata_core/adapters/sina/source_adapter_registry.py +42 -0
- axdata-0.1.0/axdata_core/adapters/tdx/__init__.py +32 -0
- axdata-0.1.0/axdata_core/adapters/tdx/adjustment.py +50 -0
- axdata-0.1.0/axdata_core/adapters/tdx/adjustment_fetch.py +51 -0
- axdata-0.1.0/axdata_core/adapters/tdx/auction_fetch.py +51 -0
- axdata-0.1.0/axdata_core/adapters/tdx/client_factory.py +110 -0
- axdata-0.1.0/axdata_core/adapters/tdx/code_fetch.py +62 -0
- axdata-0.1.0/axdata_core/adapters/tdx/codes.py +54 -0
- axdata-0.1.0/axdata_core/adapters/tdx/derived_rows.py +69 -0
- axdata-0.1.0/axdata_core/adapters/tdx/downloader.py +193 -0
- axdata-0.1.0/axdata_core/adapters/tdx/downloader_interface_sets.py +50 -0
- axdata-0.1.0/axdata_core/adapters/tdx/downloader_profiles.py +43 -0
- axdata-0.1.0/axdata_core/adapters/tdx/downloader_registry.py +115 -0
- axdata-0.1.0/axdata_core/adapters/tdx/execution_utils.py +55 -0
- axdata-0.1.0/axdata_core/adapters/tdx/f10_executor.py +57 -0
- axdata-0.1.0/axdata_core/adapters/tdx/f10_normalize.py +61 -0
- axdata-0.1.0/axdata_core/adapters/tdx/f10_params.py +57 -0
- axdata-0.1.0/axdata_core/adapters/tdx/f10_postprocess.py +67 -0
- axdata-0.1.0/axdata_core/adapters/tdx/f10_render.py +48 -0
- axdata-0.1.0/axdata_core/adapters/tdx/f10_request.py +62 -0
- axdata-0.1.0/axdata_core/adapters/tdx/finance_fetch.py +61 -0
- axdata-0.1.0/axdata_core/adapters/tdx/finance_maps.py +54 -0
- axdata-0.1.0/axdata_core/adapters/tdx/finance_normalize.py +57 -0
- axdata-0.1.0/axdata_core/adapters/tdx/host_config.py +115 -0
- axdata-0.1.0/axdata_core/adapters/tdx/interface_sets.py +50 -0
- axdata-0.1.0/axdata_core/adapters/tdx/intraday_fetch.py +68 -0
- axdata-0.1.0/axdata_core/adapters/tdx/kline_helpers.py +58 -0
- axdata-0.1.0/axdata_core/adapters/tdx/limit_ladder_fetch.py +60 -0
- axdata-0.1.0/axdata_core/adapters/tdx/limit_ladder_topics.py +53 -0
- axdata-0.1.0/axdata_core/adapters/tdx/normalize_utils.py +75 -0
- axdata-0.1.0/axdata_core/adapters/tdx/options.py +61 -0
- axdata-0.1.0/axdata_core/adapters/tdx/price_limit_calendar.py +49 -0
- axdata-0.1.0/axdata_core/adapters/tdx/price_limit_fetch.py +53 -0
- axdata-0.1.0/axdata_core/adapters/tdx/price_limit_history.py +50 -0
- axdata-0.1.0/axdata_core/adapters/tdx/price_limits.py +58 -0
- axdata-0.1.0/axdata_core/adapters/tdx/provider_bridge.py +68 -0
- axdata-0.1.0/axdata_core/adapters/tdx/quote_fetch.py +61 -0
- axdata-0.1.0/axdata_core/adapters/tdx/quote_identity.py +49 -0
- axdata-0.1.0/axdata_core/adapters/tdx/rank_fetch.py +55 -0
- axdata-0.1.0/axdata_core/adapters/tdx/rank_params.py +52 -0
- axdata-0.1.0/axdata_core/adapters/tdx/realtime_refresh.py +45 -0
- axdata-0.1.0/axdata_core/adapters/tdx/request.py +11 -0
- axdata-0.1.0/axdata_core/adapters/tdx/request_adapter_runtime.py +41 -0
- axdata-0.1.0/axdata_core/adapters/tdx/request_client.py +51 -0
- axdata-0.1.0/axdata_core/adapters/tdx/request_compat.py +89 -0
- axdata-0.1.0/axdata_core/adapters/tdx/request_dispatch.py +50 -0
- axdata-0.1.0/axdata_core/adapters/tdx/request_filters.py +60 -0
- axdata-0.1.0/axdata_core/adapters/tdx/request_host_config.py +110 -0
- axdata-0.1.0/axdata_core/adapters/tdx/request_limits.py +59 -0
- axdata-0.1.0/axdata_core/adapters/tdx/request_methods.py +41 -0
- axdata-0.1.0/axdata_core/adapters/tdx/request_params.py +62 -0
- axdata-0.1.0/axdata_core/adapters/tdx/request_seams.py +41 -0
- axdata-0.1.0/axdata_core/adapters/tdx/resources/__init__.py +0 -0
- axdata-0.1.0/axdata_core/adapters/tdx/resources/finance_maps/__init__.py +0 -0
- axdata-0.1.0/axdata_core/adapters/tdx/resources/finance_maps/incon.dat +3702 -0
- axdata-0.1.0/axdata_core/adapters/tdx/resources/finance_maps/tdxhy.cfg +5620 -0
- axdata-0.1.0/axdata_core/adapters/tdx/resources/finance_maps/tdxzs.cfg +605 -0
- axdata-0.1.0/axdata_core/adapters/tdx/security_codes.py +54 -0
- axdata-0.1.0/axdata_core/adapters/tdx/series_history.py +57 -0
- axdata-0.1.0/axdata_core/adapters/tdx/server_cache.py +58 -0
- axdata-0.1.0/axdata_core/adapters/tdx/snapshot_normalize.py +56 -0
- axdata-0.1.0/axdata_core/adapters/tdx/source_adapter_registry.py +69 -0
- axdata-0.1.0/axdata_core/adapters/tdx/source_execution.py +44 -0
- axdata-0.1.0/axdata_core/adapters/tdx/source_execution_registry.py +70 -0
- axdata-0.1.0/axdata_core/adapters/tdx/stats_cache.py +184 -0
- axdata-0.1.0/axdata_core/adapters/tdx/stats_models.py +159 -0
- axdata-0.1.0/axdata_core/adapters/tdx/stats_resource.py +304 -0
- axdata-0.1.0/axdata_core/adapters/tdx/status_fetch.py +55 -0
- axdata-0.1.0/axdata_core/adapters/tdx/time_series_normalize.py +67 -0
- axdata-0.1.0/axdata_core/adapters/tdx/tqlex.py +50 -0
- axdata-0.1.0/axdata_core/adapters/tdx/wire_requests.py +60 -0
- axdata-0.1.0/axdata_core/adapters/tdx_ext/__init__.py +66 -0
- axdata-0.1.0/axdata_core/adapters/tdx_ext/client.py +688 -0
- axdata-0.1.0/axdata_core/adapters/tdx_ext/exceptions.py +51 -0
- axdata-0.1.0/axdata_core/adapters/tdx_ext/host_config.py +40 -0
- axdata-0.1.0/axdata_core/adapters/tdx_ext/interface_sets.py +65 -0
- axdata-0.1.0/axdata_core/adapters/tdx_ext/local_cache.py +649 -0
- axdata-0.1.0/axdata_core/adapters/tdx_ext/models.py +96 -0
- axdata-0.1.0/axdata_core/adapters/tdx_ext/options.py +36 -0
- axdata-0.1.0/axdata_core/adapters/tdx_ext/pool.py +153 -0
- axdata-0.1.0/axdata_core/adapters/tdx_ext/provider_bridge.py +35 -0
- axdata-0.1.0/axdata_core/adapters/tdx_ext/request.py +498 -0
- axdata-0.1.0/axdata_core/adapters/tdx_ext/request_execution.py +118 -0
- axdata-0.1.0/axdata_core/adapters/tdx_ext/request_instruments.py +221 -0
- axdata-0.1.0/axdata_core/adapters/tdx_ext/request_normalize.py +356 -0
- axdata-0.1.0/axdata_core/adapters/tdx_ext/request_params.py +157 -0
- axdata-0.1.0/axdata_core/adapters/tdx_ext/request_series.py +98 -0
- axdata-0.1.0/axdata_core/adapters/tdx_ext/server_cache.py +13 -0
- axdata-0.1.0/axdata_core/adapters/tdx_ext/servers.py +35 -0
- axdata-0.1.0/axdata_core/adapters/tdx_ext/source_adapter_registry.py +42 -0
- axdata-0.1.0/axdata_core/adapters/tdx_ext/source_execution.py +19 -0
- axdata-0.1.0/axdata_core/adapters/tdx_ext/source_execution_registry.py +43 -0
- axdata-0.1.0/axdata_core/adapters/tencent/__init__.py +17 -0
- axdata-0.1.0/axdata_core/adapters/tencent/provider_bridge.py +25 -0
- axdata-0.1.0/axdata_core/adapters/tencent/request.py +729 -0
- axdata-0.1.0/axdata_core/adapters/tencent/source_adapter_registry.py +42 -0
- axdata-0.1.0/axdata_core/axp.py +1843 -0
- axdata-0.1.0/axdata_core/builtin_providers.py +586 -0
- axdata-0.1.0/axdata_core/builtin_source_declarations.py +156 -0
- axdata-0.1.0/axdata_core/cli.py +1818 -0
- axdata-0.1.0/axdata_core/collector_registry.py +227 -0
- axdata-0.1.0/axdata_core/collector_runner.py +1016 -0
- axdata-0.1.0/axdata_core/collector_scheduler.py +3155 -0
- axdata-0.1.0/axdata_core/collector_templates.py +339 -0
- axdata-0.1.0/axdata_core/data_browser.py +1696 -0
- axdata-0.1.0/axdata_core/diagnostics.py +734 -0
- axdata-0.1.0/axdata_core/downloader_engine.py +1480 -0
- axdata-0.1.0/axdata_core/downloader_registry.py +62 -0
- axdata-0.1.0/axdata_core/downloaders.py +1619 -0
- axdata-0.1.0/axdata_core/legacy_provider_adapter.py +68 -0
- axdata-0.1.0/axdata_core/paths.py +51 -0
- axdata-0.1.0/axdata_core/plugin_config.py +272 -0
- axdata-0.1.0/axdata_core/plugin_status.py +419 -0
- axdata-0.1.0/axdata_core/plugins.py +1363 -0
- axdata-0.1.0/axdata_core/provider_catalog.py +462 -0
- axdata-0.1.0/axdata_core/provider_registry.py +833 -0
- axdata-0.1.0/axdata_core/quality.py +86 -0
- axdata-0.1.0/axdata_core/query.py +242 -0
- axdata-0.1.0/axdata_core/resources/__init__.py +2 -0
- axdata-0.1.0/axdata_core/resources/tdx_extended_servers.json +22 -0
- axdata-0.1.0/axdata_core/resources/tdx_quote_servers.json +49 -0
- axdata-0.1.0/axdata_core/sample_collectors.py +42 -0
- axdata-0.1.0/axdata_core/schema.py +385 -0
- axdata-0.1.0/axdata_core/source_adapter_factory.py +95 -0
- axdata-0.1.0/axdata_core/source_adapter_options.py +18 -0
- axdata-0.1.0/axdata_core/source_errors.py +43 -0
- axdata-0.1.0/axdata_core/source_execution_options.py +37 -0
- axdata-0.1.0/axdata_core/source_execution_registry.py +27 -0
- axdata-0.1.0/axdata_core/source_projection.py +21 -0
- axdata-0.1.0/axdata_core/source_request.py +441 -0
- axdata-0.1.0/axdata_core/source_session.py +355 -0
- axdata-0.1.0/axdata_core/sources/__init__.py +40 -0
- axdata-0.1.0/axdata_core/sources/base.py +112 -0
- axdata-0.1.0/axdata_core/sources/catalog.py +60 -0
- axdata-0.1.0/axdata_core/sources/cls/__init__.py +5 -0
- axdata-0.1.0/axdata_core/sources/cls/catalog.py +231 -0
- axdata-0.1.0/axdata_core/sources/cninfo/__init__.py +5 -0
- axdata-0.1.0/axdata_core/sources/cninfo/catalog.py +1994 -0
- axdata-0.1.0/axdata_core/sources/display_docs.py +139 -0
- axdata-0.1.0/axdata_core/sources/eastmoney/__init__.py +5 -0
- axdata-0.1.0/axdata_core/sources/eastmoney/catalog.py +509 -0
- axdata-0.1.0/axdata_core/sources/exchange/__init__.py +5 -0
- axdata-0.1.0/axdata_core/sources/exchange/catalog.py +361 -0
- axdata-0.1.0/axdata_core/sources/kph/__init__.py +5 -0
- axdata-0.1.0/axdata_core/sources/kph/catalog.py +255 -0
- axdata-0.1.0/axdata_core/sources/sina/__init__.py +5 -0
- axdata-0.1.0/axdata_core/sources/sina/catalog.py +2951 -0
- axdata-0.1.0/axdata_core/sources/tdx/__init__.py +5 -0
- axdata-0.1.0/axdata_core/sources/tdx/catalog.py +4546 -0
- axdata-0.1.0/axdata_core/sources/tdx_ext/__init__.py +5 -0
- axdata-0.1.0/axdata_core/sources/tdx_ext/catalog.py +1518 -0
- axdata-0.1.0/axdata_core/sources/tencent/__init__.py +5 -0
- axdata-0.1.0/axdata_core/sources/tencent/catalog.py +370 -0
- axdata-0.1.0/axdata_core/storage.py +186 -0
- axdata-0.1.0/axdata_core/tdx_f10_catalog.py +52 -0
- axdata-0.1.0/axdata_core/tdx_f10_models.py +50 -0
- axdata-0.1.0/axdata_core/tdx_f10_names.py +47 -0
- axdata-0.1.0/axdata_core/tdx_f10_specs.py +56 -0
- axdata-0.1.0/axdata_core/tdx_plugin_required.py +43 -0
- axdata-0.1.0/axdata_core/tdx_server_config.py +65 -0
- axdata-0.1.0/axdata_core/trade_calendar_cache.py +397 -0
- axdata-0.1.0/axdata_source_cninfo/__init__.py +15 -0
- axdata-0.1.0/axdata_source_cninfo/adapter.py +31 -0
- axdata-0.1.0/axdata_source_cninfo/axdata-provider.json +384 -0
- axdata-0.1.0/axdata_source_cninfo/catalog.py +209 -0
- axdata-0.1.0/axdata_source_cninfo/metadata.py +8 -0
- axdata-0.1.0/axdata_source_cninfo/provider.py +41 -0
- axdata-0.1.0/axdata_source_tdx/__init__.py +15 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/__init__.py +26 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/_binary.py +218 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/_code_utils.py +42 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/_command_codec.py +186 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/_command_codes.py +74 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/_command_defaults.py +15 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/_command_dispatch.py +96 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/_command_layouts.py +96 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/_command_lookup.py +25 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/_command_metadata.py +32 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/_command_registry.py +61 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/_connection_defaults.py +13 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/_host_defaults.py +51 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/_host_probe.py +81 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/_host_resource.py +70 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/_host_utils.py +31 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/_market.py +66 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/_request_defaults.py +11 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/_security_classification.py +61 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/_time_utils.py +7 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/api/__init__.py +45 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/api/auction.py +25 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/api/bars.py +31 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/api/base.py +39 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/api/codes.py +25 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/api/corporate.py +11 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/api/finance.py +10 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/api/intraday.py +38 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/api/quotes.py +78 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/api/resources.py +34 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/api/session.py +16 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/api/trades.py +34 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/client.py +470 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/exceptions.py +25 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/hosts.py +27 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/models/__init__.py +87 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/models/auction.py +58 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/models/corporate.py +59 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/models/finance.py +80 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/models/intraday.py +112 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/models/kline.py +58 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/models/quote.py +262 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/models/resource.py +18 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/models/security.py +28 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/models/session.py +30 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/models/subchart.py +39 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/models/trade.py +46 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/protocol/__init__.py +43 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/protocol/_frame_constants.py +5 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/protocol/commands/__init__.py +37 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/protocol/commands/auction.py +165 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/protocol/commands/codec.py +37 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/protocol/commands/corporate.py +163 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/protocol/commands/finance.py +180 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/protocol/commands/intraday.py +382 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/protocol/commands/klines.py +396 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/protocol/commands/lookup.py +31 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/protocol/commands/price_limits.py +110 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/protocol/commands/quotes.py +804 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/protocol/commands/registry.py +30 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/protocol/commands/resources.py +107 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/protocol/commands/security.py +163 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/protocol/commands/session.py +129 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/protocol/commands/subchart.py +182 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/protocol/commands/trades.py +275 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/protocol/constants.py +70 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/protocol/frame.py +141 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/protocol/unit.py +98 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/py.typed +1 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/transport/__init__.py +28 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/transport/base.py +21 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/transport/memory.py +42 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/transport/pool.py +148 -0
- axdata-0.1.0/axdata_source_tdx/_tdx_wire/transport/socket.py +373 -0
- axdata-0.1.0/axdata_source_tdx/adapter.py +31 -0
- axdata-0.1.0/axdata_source_tdx/adjustment.py +163 -0
- axdata-0.1.0/axdata_source_tdx/adjustment_fetch.py +148 -0
- axdata-0.1.0/axdata_source_tdx/auction_fetch.py +162 -0
- axdata-0.1.0/axdata_source_tdx/axdata-provider.json +23680 -0
- axdata-0.1.0/axdata_source_tdx/catalog.py +39 -0
- axdata-0.1.0/axdata_source_tdx/client_factory.py +61 -0
- axdata-0.1.0/axdata_source_tdx/code_fetch.py +579 -0
- axdata-0.1.0/axdata_source_tdx/codes.py +69 -0
- axdata-0.1.0/axdata_source_tdx/collectors.py +525 -0
- axdata-0.1.0/axdata_source_tdx/derived_rows.py +500 -0
- axdata-0.1.0/axdata_source_tdx/downloader.py +139 -0
- axdata-0.1.0/axdata_source_tdx/downloader_interface_sets.py +29 -0
- axdata-0.1.0/axdata_source_tdx/downloader_profiles.py +731 -0
- axdata-0.1.0/axdata_source_tdx/downloader_registry.py +85 -0
- axdata-0.1.0/axdata_source_tdx/execution_utils.py +141 -0
- axdata-0.1.0/axdata_source_tdx/f10_executor.py +414 -0
- axdata-0.1.0/axdata_source_tdx/f10_normalize.py +169 -0
- axdata-0.1.0/axdata_source_tdx/f10_params.py +221 -0
- axdata-0.1.0/axdata_source_tdx/f10_postprocess.py +405 -0
- axdata-0.1.0/axdata_source_tdx/f10_render.py +29 -0
- axdata-0.1.0/axdata_source_tdx/f10_request.py +365 -0
- axdata-0.1.0/axdata_source_tdx/finance_fetch.py +514 -0
- axdata-0.1.0/axdata_source_tdx/finance_maps.py +377 -0
- axdata-0.1.0/axdata_source_tdx/finance_normalize.py +273 -0
- axdata-0.1.0/axdata_source_tdx/host_config.py +51 -0
- axdata-0.1.0/axdata_source_tdx/interface_sets.py +180 -0
- axdata-0.1.0/axdata_source_tdx/intraday_fetch.py +600 -0
- axdata-0.1.0/axdata_source_tdx/kline_helpers.py +333 -0
- axdata-0.1.0/axdata_source_tdx/limit_ladder_fetch.py +614 -0
- axdata-0.1.0/axdata_source_tdx/limit_ladder_topics.py +280 -0
- axdata-0.1.0/axdata_source_tdx/metadata.py +8 -0
- axdata-0.1.0/axdata_source_tdx/normalize_utils.py +264 -0
- axdata-0.1.0/axdata_source_tdx/options.py +195 -0
- axdata-0.1.0/axdata_source_tdx/price_limit_calendar.py +106 -0
- axdata-0.1.0/axdata_source_tdx/price_limit_fetch.py +264 -0
- axdata-0.1.0/axdata_source_tdx/price_limit_history.py +100 -0
- axdata-0.1.0/axdata_source_tdx/price_limits.py +142 -0
- axdata-0.1.0/axdata_source_tdx/provider.py +44 -0
- axdata-0.1.0/axdata_source_tdx/provider_bridge.py +43 -0
- axdata-0.1.0/axdata_source_tdx/quote_fetch.py +485 -0
- axdata-0.1.0/axdata_source_tdx/quote_identity.py +50 -0
- axdata-0.1.0/axdata_source_tdx/rank_fetch.py +316 -0
- axdata-0.1.0/axdata_source_tdx/rank_params.py +181 -0
- axdata-0.1.0/axdata_source_tdx/realtime_refresh.py +51 -0
- axdata-0.1.0/axdata_source_tdx/request_adapter.py +533 -0
- axdata-0.1.0/axdata_source_tdx/request_adapter_runtime.py +302 -0
- axdata-0.1.0/axdata_source_tdx/request_client.py +98 -0
- axdata-0.1.0/axdata_source_tdx/request_compat.py +432 -0
- axdata-0.1.0/axdata_source_tdx/request_dispatch.py +138 -0
- axdata-0.1.0/axdata_source_tdx/request_entrypoints.py +146 -0
- axdata-0.1.0/axdata_source_tdx/request_filters.py +154 -0
- axdata-0.1.0/axdata_source_tdx/request_host_config.py +103 -0
- axdata-0.1.0/axdata_source_tdx/request_limits.py +15 -0
- axdata-0.1.0/axdata_source_tdx/request_methods.py +1910 -0
- axdata-0.1.0/axdata_source_tdx/request_params.py +225 -0
- axdata-0.1.0/axdata_source_tdx/request_seams.py +534 -0
- axdata-0.1.0/axdata_source_tdx/resources/__init__.py +0 -0
- axdata-0.1.0/axdata_source_tdx/resources/finance_maps/__init__.py +1 -0
- axdata-0.1.0/axdata_source_tdx/resources/finance_maps/incon.dat +3702 -0
- axdata-0.1.0/axdata_source_tdx/resources/finance_maps/tdxhy.cfg +5620 -0
- axdata-0.1.0/axdata_source_tdx/resources/finance_maps/tdxzs.cfg +605 -0
- axdata-0.1.0/axdata_source_tdx/resources/tdx_extended_servers.json +22 -0
- axdata-0.1.0/axdata_source_tdx/resources/tdx_quote_servers.json +49 -0
- axdata-0.1.0/axdata_source_tdx/security_codes.py +127 -0
- axdata-0.1.0/axdata_source_tdx/series_history.py +348 -0
- axdata-0.1.0/axdata_source_tdx/server_cache.py +21 -0
- axdata-0.1.0/axdata_source_tdx/snapshot_normalize.py +232 -0
- axdata-0.1.0/axdata_source_tdx/source_adapter_registry.py +42 -0
- axdata-0.1.0/axdata_source_tdx/source_execution.py +22 -0
- axdata-0.1.0/axdata_source_tdx/source_execution_registry.py +43 -0
- axdata-0.1.0/axdata_source_tdx/stats_cache.py +150 -0
- axdata-0.1.0/axdata_source_tdx/stats_models.py +161 -0
- axdata-0.1.0/axdata_source_tdx/stats_resource.py +242 -0
- axdata-0.1.0/axdata_source_tdx/status_fetch.py +209 -0
- axdata-0.1.0/axdata_source_tdx/tdx_f10_catalog.py +957 -0
- axdata-0.1.0/axdata_source_tdx/tdx_f10_models.py +47 -0
- axdata-0.1.0/axdata_source_tdx/tdx_f10_names.py +48 -0
- axdata-0.1.0/axdata_source_tdx/tdx_f10_specs.py +1142 -0
- axdata-0.1.0/axdata_source_tdx/tdx_server_config.py +389 -0
- axdata-0.1.0/axdata_source_tdx/time_series_normalize.py +370 -0
- axdata-0.1.0/axdata_source_tdx/tqlex.py +138 -0
- axdata-0.1.0/axdata_source_tdx/wire.py +32 -0
- axdata-0.1.0/axdata_source_tdx/wire_requests.py +190 -0
- axdata-0.1.0/axdata_source_tdx_ext/__init__.py +15 -0
- axdata-0.1.0/axdata_source_tdx_ext/adapter.py +31 -0
- axdata-0.1.0/axdata_source_tdx_ext/axdata-provider.json +9424 -0
- axdata-0.1.0/axdata_source_tdx_ext/catalog.py +33 -0
- axdata-0.1.0/axdata_source_tdx_ext/metadata.py +8 -0
- axdata-0.1.0/axdata_source_tdx_ext/provider.py +44 -0
- axdata-0.1.0/axdata_source_tencent/__init__.py +15 -0
- axdata-0.1.0/axdata_source_tencent/adapter.py +31 -0
- axdata-0.1.0/axdata_source_tencent/axdata-provider.json +291 -0
- axdata-0.1.0/axdata_source_tencent/catalog.py +190 -0
- axdata-0.1.0/axdata_source_tencent/metadata.py +8 -0
- axdata-0.1.0/axdata_source_tencent/provider.py +41 -0
- axdata-0.1.0/pyproject.toml +73 -0
- axdata-0.1.0/setup.cfg +4 -0
axdata-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction, and
|
|
10
|
+
distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by the
|
|
13
|
+
copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all other
|
|
16
|
+
entities that control, are controlled by, or are under common control with
|
|
17
|
+
that entity. For the purposes of this definition, "control" means (i) the
|
|
18
|
+
power, direct or indirect, to cause the direction or management of such
|
|
19
|
+
entity, whether by contract or otherwise, or (ii) ownership of fifty percent
|
|
20
|
+
(50%) or more of the outstanding shares, or (iii) beneficial ownership of such
|
|
21
|
+
entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity exercising
|
|
24
|
+
permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation source, and
|
|
28
|
+
configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical transformation or
|
|
31
|
+
translation of a Source form, including but not limited to compiled object
|
|
32
|
+
code, generated documentation, and conversions to other media types.
|
|
33
|
+
|
|
34
|
+
"Work" shall mean the work of authorship, whether in Source or Object form,
|
|
35
|
+
made available under the License, as indicated by a copyright notice that is
|
|
36
|
+
included in or attached to the work (an example is provided in the Appendix
|
|
37
|
+
below).
|
|
38
|
+
|
|
39
|
+
"Derivative Works" shall mean any work, whether in Source or Object form, that
|
|
40
|
+
is based on (or derived from) the Work and for which the editorial revisions,
|
|
41
|
+
annotations, elaborations, or other modifications represent, as a whole, an
|
|
42
|
+
original work of authorship. For the purposes of this License, Derivative
|
|
43
|
+
Works shall not include works that remain separable from, or merely link (or
|
|
44
|
+
bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
|
45
|
+
|
|
46
|
+
"Contribution" shall mean any work of authorship, including the original
|
|
47
|
+
version of the Work and any modifications or additions to that Work or
|
|
48
|
+
Derivative Works thereof, that is intentionally submitted to Licensor for
|
|
49
|
+
inclusion in the Work by the copyright owner or by an individual or Legal
|
|
50
|
+
Entity authorized to submit on behalf of the copyright owner. For the purposes
|
|
51
|
+
of this definition, "submitted" means any form of electronic, verbal, or
|
|
52
|
+
written communication sent to the Licensor or its representatives, including
|
|
53
|
+
but not limited to communication on electronic mailing lists, source code
|
|
54
|
+
control systems, and issue tracking systems that are managed by, or on behalf
|
|
55
|
+
of, the Licensor for the purpose of discussing and improving the Work, but
|
|
56
|
+
excluding communication that is conspicuously marked or otherwise designated
|
|
57
|
+
in writing by the copyright owner as "Not a Contribution."
|
|
58
|
+
|
|
59
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity on
|
|
60
|
+
behalf of whom a Contribution has been received by Licensor and subsequently
|
|
61
|
+
incorporated within the Work.
|
|
62
|
+
|
|
63
|
+
2. Grant of Copyright License. Subject to the terms and conditions of this
|
|
64
|
+
License, each Contributor hereby grants to You a perpetual, worldwide,
|
|
65
|
+
non-exclusive, no-charge, royalty-free, irrevocable copyright license to
|
|
66
|
+
reproduce, prepare Derivative Works of, publicly display, publicly perform,
|
|
67
|
+
sublicense, and distribute the Work and such Derivative Works in Source or
|
|
68
|
+
Object form.
|
|
69
|
+
|
|
70
|
+
3. Grant of Patent License. Subject to the terms and conditions of this
|
|
71
|
+
License, each Contributor hereby grants to You a perpetual, worldwide,
|
|
72
|
+
non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this
|
|
73
|
+
section) patent license to make, have made, use, offer to sell, sell, import,
|
|
74
|
+
and otherwise transfer the Work, where such license applies only to those
|
|
75
|
+
patent claims licensable by such Contributor that are necessarily infringed by
|
|
76
|
+
their Contribution(s) alone or by combination of their Contribution(s) with the
|
|
77
|
+
Work to which such Contribution(s) was submitted. If You institute patent
|
|
78
|
+
litigation against any entity (including a cross-claim or counterclaim in a
|
|
79
|
+
lawsuit) alleging that the Work or a Contribution incorporated within the Work
|
|
80
|
+
constitutes direct or contributory patent infringement, then any patent
|
|
81
|
+
licenses granted to You under this License for that Work shall terminate as of
|
|
82
|
+
the date such litigation is filed.
|
|
83
|
+
|
|
84
|
+
4. Redistribution. You may reproduce and distribute copies of the Work or
|
|
85
|
+
Derivative Works thereof in any medium, with or without modifications, and in
|
|
86
|
+
Source or Object form, provided that You meet the following conditions:
|
|
87
|
+
|
|
88
|
+
(a) You must give any other recipients of the Work or Derivative Works a copy
|
|
89
|
+
of this License; and
|
|
90
|
+
|
|
91
|
+
(b) You must cause any modified files to carry prominent notices stating that
|
|
92
|
+
You changed the files; and
|
|
93
|
+
|
|
94
|
+
(c) You must retain, in the Source form of any Derivative Works that You
|
|
95
|
+
distribute, all copyright, patent, trademark, and attribution notices from the
|
|
96
|
+
Source form of the Work, excluding those notices that do not pertain to any
|
|
97
|
+
part of the Derivative Works; and
|
|
98
|
+
|
|
99
|
+
(d) If the Work includes a "NOTICE" text file as part of its distribution, then
|
|
100
|
+
any Derivative Works that You distribute must include a readable copy of the
|
|
101
|
+
attribution notices contained within such NOTICE file, excluding those notices
|
|
102
|
+
that do not pertain to any part of the Derivative Works, in at least one of the
|
|
103
|
+
following places: within a NOTICE text file distributed as part of the
|
|
104
|
+
Derivative Works; within the Source form or documentation, if provided along
|
|
105
|
+
with the Derivative Works; or, within a display generated by the Derivative
|
|
106
|
+
Works, if and wherever such third-party notices normally appear. The contents
|
|
107
|
+
of the NOTICE file are for informational purposes only and do not modify the
|
|
108
|
+
License. You may add Your own attribution notices within Derivative Works that
|
|
109
|
+
You distribute, alongside or as an addendum to the NOTICE text from the Work,
|
|
110
|
+
provided that such additional attribution notices cannot be construed as
|
|
111
|
+
modifying the License.
|
|
112
|
+
|
|
113
|
+
You may add Your own copyright statement to Your modifications and may provide
|
|
114
|
+
additional or different license terms and conditions for use, reproduction, or
|
|
115
|
+
distribution of Your modifications, or for any such Derivative Works as a
|
|
116
|
+
whole, provided Your use, reproduction, and distribution of the Work otherwise
|
|
117
|
+
complies with the conditions stated in this License.
|
|
118
|
+
|
|
119
|
+
5. Submission of Contributions. Unless You explicitly state otherwise, any
|
|
120
|
+
Contribution intentionally submitted for inclusion in the Work by You to the
|
|
121
|
+
Licensor shall be under the terms and conditions of this License, without any
|
|
122
|
+
additional terms or conditions. Notwithstanding the above, nothing herein shall
|
|
123
|
+
supersede or modify the terms of any separate license agreement you may have
|
|
124
|
+
executed with Licensor regarding such Contributions.
|
|
125
|
+
|
|
126
|
+
6. Trademarks. This License does not grant permission to use the trade names,
|
|
127
|
+
trademarks, service marks, or product names of the Licensor, except as required
|
|
128
|
+
for reasonable and customary use in describing the origin of the Work and
|
|
129
|
+
reproducing the content of the NOTICE file.
|
|
130
|
+
|
|
131
|
+
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
|
|
132
|
+
writing, Licensor provides the Work (and each Contributor provides its
|
|
133
|
+
Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
134
|
+
KIND, either express or implied, including, without limitation, any warranties
|
|
135
|
+
or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
136
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
137
|
+
appropriateness of using or redistributing the Work and assume any risks
|
|
138
|
+
associated with Your exercise of permissions under this License.
|
|
139
|
+
|
|
140
|
+
8. Limitation of Liability. In no event and under no legal theory, whether in
|
|
141
|
+
tort (including negligence), contract, or otherwise, unless required by
|
|
142
|
+
applicable law (such as deliberate and grossly negligent acts) or agreed to in
|
|
143
|
+
writing, shall any Contributor be liable to You for damages, including any
|
|
144
|
+
direct, indirect, special, incidental, or consequential damages of any
|
|
145
|
+
character arising as a result of this License or out of the use or inability to
|
|
146
|
+
use the Work (including but not limited to damages for loss of goodwill, work
|
|
147
|
+
stoppage, computer failure or malfunction, or any and all other commercial
|
|
148
|
+
damages or losses), even if such Contributor has been advised of the
|
|
149
|
+
possibility of such damages.
|
|
150
|
+
|
|
151
|
+
9. Accepting Warranty or Additional Liability. While redistributing the Work or
|
|
152
|
+
Derivative Works thereof, You may choose to offer, and charge a fee for,
|
|
153
|
+
acceptance of support, warranty, indemnity, or other liability obligations
|
|
154
|
+
and/or rights consistent with this License. However, in accepting such
|
|
155
|
+
obligations, You may act only on Your own behalf and on Your sole
|
|
156
|
+
responsibility, not on behalf of any other Contributor, and only if You agree
|
|
157
|
+
to indemnify, defend, and hold each Contributor harmless for any liability
|
|
158
|
+
incurred by, or claims asserted against, such Contributor by reason of your
|
|
159
|
+
accepting any such warranty or additional liability.
|
|
160
|
+
|
|
161
|
+
END OF TERMS AND CONDITIONS
|
|
162
|
+
|
axdata-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: axdata
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Open-source quantitative database framework and Python SDK.
|
|
5
|
+
Author: AxData
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Classifier: Development Status :: 3 - Alpha
|
|
8
|
+
Classifier: Intended Audience :: Developers
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
13
|
+
Requires-Python: >=3.11
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
License-File: LICENSE
|
|
16
|
+
Requires-Dist: duckdb>=0.9
|
|
17
|
+
Requires-Dist: fastapi>=0.115.0
|
|
18
|
+
Requires-Dist: lxml>=5.2.0
|
|
19
|
+
Requires-Dist: packaging>=23
|
|
20
|
+
Requires-Dist: pandas>=1.5.0
|
|
21
|
+
Requires-Dist: pyarrow>=16.0.0
|
|
22
|
+
Requires-Dist: pydantic>=2.7.0
|
|
23
|
+
Requires-Dist: python-multipart>=0.0.9
|
|
24
|
+
Requires-Dist: requests>=2.31.0
|
|
25
|
+
Requires-Dist: uvicorn[standard]>=0.30.0
|
|
26
|
+
Requires-Dist: websocket-client>=1.8.0
|
|
27
|
+
Dynamic: license-file
|
|
28
|
+
|
|
29
|
+
# AxData Python SDK
|
|
30
|
+
|
|
31
|
+
PyPI 发布后,可用下面的命令安装轻量 SDK/CLI 包:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install axdata
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
`axdata` 是用户侧唯一推荐安装入口。公开发布的 wheel 会同时带上 AxData SDK、
|
|
38
|
+
CLI/API 运行依赖、核心框架和默认随包数据源 Provider 能力。
|
|
39
|
+
|
|
40
|
+
TDX/TDX Ext source-provider 包安装后默认可用。`axdata doctor` 或 `axdata plugin list`
|
|
41
|
+
只用于检查本地环境,不是使用 SDK 前的强制步骤。
|
|
42
|
+
|
|
43
|
+
源码开发时,仓库内部仍然按 core、SDK、数据源插件分目录维护。可以用 editable
|
|
44
|
+
模式安装本地包:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pip install -e "../../libs/axdata_core"
|
|
48
|
+
pip install -e "."
|
|
49
|
+
pip install -e "../axdata-source-tdx"
|
|
50
|
+
pip install -e "../axdata-source-tdx-ext"
|
|
51
|
+
pip install -e "../axdata-source-tencent"
|
|
52
|
+
pip install -e "../axdata-source-cninfo"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
公开 PyPI 包会把 `axdata_core` 和默认随包数据源模块打进同一个 `axdata` wheel。
|
|
56
|
+
默认本地模式可以直接读取
|
|
57
|
+
Parquet/DuckDB 数据、调用本机 Provider 接口,并运行 AxData CLI 诊断;不需要先启动 HTTP 服务。
|
|
58
|
+
|
|
59
|
+
包名是 `axdata`,导入方式如下:
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
import axdata as ax
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## 基础用法
|
|
66
|
+
|
|
67
|
+
```python
|
|
68
|
+
import axdata as ax
|
|
69
|
+
|
|
70
|
+
client = ax.AxDataClient()
|
|
71
|
+
|
|
72
|
+
stocks = client.stock_basic_exchange(
|
|
73
|
+
exchange="SSE",
|
|
74
|
+
region="上海市",
|
|
75
|
+
listing_status="listed",
|
|
76
|
+
fields=["instrument_id", "name", "region", "company_full_name", "list_date"],
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
one_stock = client.stock_basic_exchange(
|
|
80
|
+
instrument_id="600000.SH",
|
|
81
|
+
fields=["instrument_id", "symbol", "exchange", "name", "list_date"],
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
bars = client.daily(
|
|
85
|
+
ts_code="000001.SZ",
|
|
86
|
+
start_date="20250101",
|
|
87
|
+
end_date="20250131",
|
|
88
|
+
fields=["ts_code", "trade_date", "open", "close"],
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
print(stocks.head())
|
|
92
|
+
print(one_stock.head())
|
|
93
|
+
print(bars.head())
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
查询 `stock_basic_exchange` 时,精确查一只股票建议使用 `instrument_id=600000.SH`。
|
|
97
|
+
按交易所筛选时使用 `exchange=SSE`、`exchange=SZSE` 或 `exchange=BSE`。
|
|
98
|
+
`.SH/.SZ/.BJ` 后缀属于 `instrument_id`。
|
|
99
|
+
|
|
100
|
+
SDK 是主要用户入口。默认本地模式通过 `axdata_core` 和 DuckDB 读取当前机器的 AxData
|
|
101
|
+
数据目录。Notebook、脚本、回测或因子研究不需要先启动本地 HTTP 服务。
|
|
102
|
+
|
|
103
|
+
```python
|
|
104
|
+
local = ax.AxDataClient()
|
|
105
|
+
snapshot = ax.AxDataClient(data_root="/data/axdata-snapshot")
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Pass `api_base` only when the same SDK calls should go through an AxData HTTP
|
|
109
|
+
API channel on another process, LAN machine, or cloud service. In that mode,
|
|
110
|
+
the SDK reads the data directory configured on the service that `api_base`
|
|
111
|
+
points to:
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
remote = ax.AxDataClient(api_base="http://192.168.1.20:8666", token="your-token")
|
|
115
|
+
stocks = remote.stock_basic_exchange(exchange="SZSE", fields=["instrument_id", "name", "list_date"])
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Configuration can also come from environment variables:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
export AXDATA_DATA_DIR="/data/axdata/current"
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
```python
|
|
125
|
+
import axdata as ax
|
|
126
|
+
|
|
127
|
+
client = ax.AxDataClient()
|
|
128
|
+
df = client.stock_basic_exchange(exchange="SSE", fields=["instrument_id", "name"])
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
export AXDATA_API_BASE="http://192.168.1.20:8666"
|
|
133
|
+
export AXDATA_TOKEN="your-token"
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
```python
|
|
137
|
+
import axdata as ax
|
|
138
|
+
|
|
139
|
+
remote = ax.AxDataClient()
|
|
140
|
+
df = remote.daily(ts_code="000001.SZ", start_date="20250101", end_date="20250131")
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
If `AXDATA_API_BASE` is set, `AxDataClient()` uses API mode. Use
|
|
144
|
+
`AxDataClient.local(...)` or `mode="local"` when you explicitly want local
|
|
145
|
+
direct reads in an environment where `AXDATA_API_BASE` is present.
|
|
146
|
+
|
|
147
|
+
Queries read data that has already been ingested into AxData. Collection is the
|
|
148
|
+
write path that creates raw/staging/core/factor batches. Realtime snapshots and
|
|
149
|
+
subscriptions are temporary by default and do not become historical data unless
|
|
150
|
+
a recording or collection job explicitly writes them.
|
|
151
|
+
|
|
152
|
+
## API
|
|
153
|
+
|
|
154
|
+
```python
|
|
155
|
+
client = ax.AxDataClient()
|
|
156
|
+
local = ax.AxDataClient.local(data_root="/data/axdata/current")
|
|
157
|
+
remote = ax.AxDataClient.api(api_base="http://192.168.1.20:8666", token=None)
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Available methods:
|
|
161
|
+
|
|
162
|
+
- `client.query(api_name, fields=None, **params)`
|
|
163
|
+
- `client.daily(fields=None, **params)`
|
|
164
|
+
- `client.adj_factor(fields=None, **params)`
|
|
165
|
+
- `client.trade_cal(fields=None, **params)`
|
|
166
|
+
- `client.stock_basic_exchange(fields=None, **params)`
|
|
167
|
+
- `client.call(interface, fields=None, options=None, **params)` for temporary source requests such as `stock_codes_tdx`, `stock_realtime_snapshot_tdx`, `index_kline_tdx`, `stock_intraday_today_tdx`, `stock_intraday_recent_history_tdx`, `index_intraday_history_tdx`, `etf_trades_today_tdx`, and `stock_finance_summary_tdx`
|
|
168
|
+
- `client.stream(stream, fields=None, **params)` for realtime streams. Without `api_base`, supported TDX streams run locally in-process; with `api_base`, they use the remote WebSocket API.
|
|
169
|
+
- `client.session(source="tdx" | "tdx_ext", **options)` for high-frequency local TDX/TDX_EXT source requests that should reuse local provider adapters and long-connection pools.
|
|
170
|
+
- `ax.pro_api(...)`
|
|
171
|
+
- `ax.download(...)`
|
|
172
|
+
- `ax.get(...)`
|
|
173
|
+
|
|
174
|
+
In local mode, query methods read Parquet data through `axdata_core` and do not
|
|
175
|
+
need a running AxData HTTP service. In API mode, all query methods, including
|
|
176
|
+
`stock_basic_exchange()`, `daily()`, `adj_factor()`, and `trade_cal()`, post to `/v1/query`;
|
|
177
|
+
source requests through `call(...)` post to `/v1/request/{interface}`. Registered
|
|
178
|
+
TDX source previews include quote snapshots, ranking pages, order books, index
|
|
179
|
+
and ETF K-line samples, intraday/trade-detail samples, finance snapshots, and
|
|
180
|
+
concept constituents. These calls default to
|
|
181
|
+
`persist=false`: they do not write raw/staging/core/factor data and do not imply
|
|
182
|
+
that the interface has a Collector task template.
|
|
183
|
+
|
|
184
|
+
```python
|
|
185
|
+
quote = client.call(
|
|
186
|
+
"stock_realtime_snapshot_tdx",
|
|
187
|
+
code="000001.SZ",
|
|
188
|
+
fields=["instrument_id", "last_price", "change_pct"],
|
|
189
|
+
)
|
|
190
|
+
index_bars = client.call("index_kline_tdx", code="000001.SH", period="day", count=20)
|
|
191
|
+
etf_bars = client.call("etf_kline_tdx", code="510050.SH", period="day", count=20)
|
|
192
|
+
intraday = client.call("stock_intraday_today_tdx", code="000001.SZ")
|
|
193
|
+
recent_intraday = client.call("stock_intraday_recent_history_tdx", code="000001.SZ", trade_date="20260519")
|
|
194
|
+
index_intraday = client.call("index_intraday_history_tdx", code="000001.SH", trade_date="20260617")
|
|
195
|
+
etf_trades = client.call("etf_trades_today_tdx", code="510050.SH")
|
|
196
|
+
trades = client.call("stock_trades_history_tdx", code="000001.SZ", trade_date="20260511")
|
|
197
|
+
finance = client.call("stock_finance_summary_tdx", code="000001.SZ")
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
For high-frequency polling, keep a local source session open instead of looping
|
|
201
|
+
plain `client.call(...)`:
|
|
202
|
+
|
|
203
|
+
```python
|
|
204
|
+
with client.session(source="tdx", source_server_count=4, connections_per_server=2) as session:
|
|
205
|
+
snapshot = session.call("stock_realtime_snapshot_tdx", code=["000001.SZ", "600000.SH"])
|
|
206
|
+
rank = session.call("stock_realtime_rank_tdx", category="a_share")
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Realtime streams follow the same local/remote boundary:
|
|
210
|
+
|
|
211
|
+
```python
|
|
212
|
+
local = ax.AxDataClient()
|
|
213
|
+
with local.stream("stock_quote_refresh_tdx", code=["000001.SZ"]) as stream:
|
|
214
|
+
for event in stream:
|
|
215
|
+
print(event.type, event.data)
|
|
216
|
+
|
|
217
|
+
remote = ax.AxDataClient(api_base="http://192.168.1.20:8666", token="your-token")
|
|
218
|
+
with remote.stream("stock_quote_refresh_tdx", code=["000001.SZ"]) as stream:
|
|
219
|
+
for event in stream:
|
|
220
|
+
print(event.type, event.data)
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
The `code` parameter can be a single string, a list, or a comma-separated string.
|
|
224
|
+
Source-only K-line and ranking previews use bounded defaults; pass `count`
|
|
225
|
+
explicitly when you need a larger sample. Intraday, trade-detail, auction,
|
|
226
|
+
finance, index, and ETF examples remain temporary source requests, not Collector
|
|
227
|
+
task templates.
|
|
228
|
+
Token values are sent as
|
|
229
|
+
`Authorization: Bearer ...`.
|
|
230
|
+
All query methods return a `pandas.DataFrame`.
|
|
231
|
+
The SDK returns `pandas.DataFrame` objects from query and source-request calls.
|
|
232
|
+
|
|
233
|
+
The old `stock_basic()` method name may remain as a migration alias for
|
|
234
|
+
`stock_basic_exchange()`, but new notebooks and applications should use the
|
|
235
|
+
explicit interface name.
|
|
236
|
+
|
|
237
|
+
`download(...)` and `get(...)` are local cache style placeholders for now. They
|
|
238
|
+
raise `NotImplementedError` until the cache workflow is implemented.
|
axdata-0.1.0/README.md
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
# AxData Python SDK
|
|
2
|
+
|
|
3
|
+
PyPI 发布后,可用下面的命令安装轻量 SDK/CLI 包:
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
pip install axdata
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
`axdata` 是用户侧唯一推荐安装入口。公开发布的 wheel 会同时带上 AxData SDK、
|
|
10
|
+
CLI/API 运行依赖、核心框架和默认随包数据源 Provider 能力。
|
|
11
|
+
|
|
12
|
+
TDX/TDX Ext source-provider 包安装后默认可用。`axdata doctor` 或 `axdata plugin list`
|
|
13
|
+
只用于检查本地环境,不是使用 SDK 前的强制步骤。
|
|
14
|
+
|
|
15
|
+
源码开发时,仓库内部仍然按 core、SDK、数据源插件分目录维护。可以用 editable
|
|
16
|
+
模式安装本地包:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pip install -e "../../libs/axdata_core"
|
|
20
|
+
pip install -e "."
|
|
21
|
+
pip install -e "../axdata-source-tdx"
|
|
22
|
+
pip install -e "../axdata-source-tdx-ext"
|
|
23
|
+
pip install -e "../axdata-source-tencent"
|
|
24
|
+
pip install -e "../axdata-source-cninfo"
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
公开 PyPI 包会把 `axdata_core` 和默认随包数据源模块打进同一个 `axdata` wheel。
|
|
28
|
+
默认本地模式可以直接读取
|
|
29
|
+
Parquet/DuckDB 数据、调用本机 Provider 接口,并运行 AxData CLI 诊断;不需要先启动 HTTP 服务。
|
|
30
|
+
|
|
31
|
+
包名是 `axdata`,导入方式如下:
|
|
32
|
+
|
|
33
|
+
```python
|
|
34
|
+
import axdata as ax
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## 基础用法
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
import axdata as ax
|
|
41
|
+
|
|
42
|
+
client = ax.AxDataClient()
|
|
43
|
+
|
|
44
|
+
stocks = client.stock_basic_exchange(
|
|
45
|
+
exchange="SSE",
|
|
46
|
+
region="上海市",
|
|
47
|
+
listing_status="listed",
|
|
48
|
+
fields=["instrument_id", "name", "region", "company_full_name", "list_date"],
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
one_stock = client.stock_basic_exchange(
|
|
52
|
+
instrument_id="600000.SH",
|
|
53
|
+
fields=["instrument_id", "symbol", "exchange", "name", "list_date"],
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
bars = client.daily(
|
|
57
|
+
ts_code="000001.SZ",
|
|
58
|
+
start_date="20250101",
|
|
59
|
+
end_date="20250131",
|
|
60
|
+
fields=["ts_code", "trade_date", "open", "close"],
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
print(stocks.head())
|
|
64
|
+
print(one_stock.head())
|
|
65
|
+
print(bars.head())
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
查询 `stock_basic_exchange` 时,精确查一只股票建议使用 `instrument_id=600000.SH`。
|
|
69
|
+
按交易所筛选时使用 `exchange=SSE`、`exchange=SZSE` 或 `exchange=BSE`。
|
|
70
|
+
`.SH/.SZ/.BJ` 后缀属于 `instrument_id`。
|
|
71
|
+
|
|
72
|
+
SDK 是主要用户入口。默认本地模式通过 `axdata_core` 和 DuckDB 读取当前机器的 AxData
|
|
73
|
+
数据目录。Notebook、脚本、回测或因子研究不需要先启动本地 HTTP 服务。
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
local = ax.AxDataClient()
|
|
77
|
+
snapshot = ax.AxDataClient(data_root="/data/axdata-snapshot")
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Pass `api_base` only when the same SDK calls should go through an AxData HTTP
|
|
81
|
+
API channel on another process, LAN machine, or cloud service. In that mode,
|
|
82
|
+
the SDK reads the data directory configured on the service that `api_base`
|
|
83
|
+
points to:
|
|
84
|
+
|
|
85
|
+
```python
|
|
86
|
+
remote = ax.AxDataClient(api_base="http://192.168.1.20:8666", token="your-token")
|
|
87
|
+
stocks = remote.stock_basic_exchange(exchange="SZSE", fields=["instrument_id", "name", "list_date"])
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Configuration can also come from environment variables:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
export AXDATA_DATA_DIR="/data/axdata/current"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
import axdata as ax
|
|
98
|
+
|
|
99
|
+
client = ax.AxDataClient()
|
|
100
|
+
df = client.stock_basic_exchange(exchange="SSE", fields=["instrument_id", "name"])
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
export AXDATA_API_BASE="http://192.168.1.20:8666"
|
|
105
|
+
export AXDATA_TOKEN="your-token"
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
```python
|
|
109
|
+
import axdata as ax
|
|
110
|
+
|
|
111
|
+
remote = ax.AxDataClient()
|
|
112
|
+
df = remote.daily(ts_code="000001.SZ", start_date="20250101", end_date="20250131")
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
If `AXDATA_API_BASE` is set, `AxDataClient()` uses API mode. Use
|
|
116
|
+
`AxDataClient.local(...)` or `mode="local"` when you explicitly want local
|
|
117
|
+
direct reads in an environment where `AXDATA_API_BASE` is present.
|
|
118
|
+
|
|
119
|
+
Queries read data that has already been ingested into AxData. Collection is the
|
|
120
|
+
write path that creates raw/staging/core/factor batches. Realtime snapshots and
|
|
121
|
+
subscriptions are temporary by default and do not become historical data unless
|
|
122
|
+
a recording or collection job explicitly writes them.
|
|
123
|
+
|
|
124
|
+
## API
|
|
125
|
+
|
|
126
|
+
```python
|
|
127
|
+
client = ax.AxDataClient()
|
|
128
|
+
local = ax.AxDataClient.local(data_root="/data/axdata/current")
|
|
129
|
+
remote = ax.AxDataClient.api(api_base="http://192.168.1.20:8666", token=None)
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Available methods:
|
|
133
|
+
|
|
134
|
+
- `client.query(api_name, fields=None, **params)`
|
|
135
|
+
- `client.daily(fields=None, **params)`
|
|
136
|
+
- `client.adj_factor(fields=None, **params)`
|
|
137
|
+
- `client.trade_cal(fields=None, **params)`
|
|
138
|
+
- `client.stock_basic_exchange(fields=None, **params)`
|
|
139
|
+
- `client.call(interface, fields=None, options=None, **params)` for temporary source requests such as `stock_codes_tdx`, `stock_realtime_snapshot_tdx`, `index_kline_tdx`, `stock_intraday_today_tdx`, `stock_intraday_recent_history_tdx`, `index_intraday_history_tdx`, `etf_trades_today_tdx`, and `stock_finance_summary_tdx`
|
|
140
|
+
- `client.stream(stream, fields=None, **params)` for realtime streams. Without `api_base`, supported TDX streams run locally in-process; with `api_base`, they use the remote WebSocket API.
|
|
141
|
+
- `client.session(source="tdx" | "tdx_ext", **options)` for high-frequency local TDX/TDX_EXT source requests that should reuse local provider adapters and long-connection pools.
|
|
142
|
+
- `ax.pro_api(...)`
|
|
143
|
+
- `ax.download(...)`
|
|
144
|
+
- `ax.get(...)`
|
|
145
|
+
|
|
146
|
+
In local mode, query methods read Parquet data through `axdata_core` and do not
|
|
147
|
+
need a running AxData HTTP service. In API mode, all query methods, including
|
|
148
|
+
`stock_basic_exchange()`, `daily()`, `adj_factor()`, and `trade_cal()`, post to `/v1/query`;
|
|
149
|
+
source requests through `call(...)` post to `/v1/request/{interface}`. Registered
|
|
150
|
+
TDX source previews include quote snapshots, ranking pages, order books, index
|
|
151
|
+
and ETF K-line samples, intraday/trade-detail samples, finance snapshots, and
|
|
152
|
+
concept constituents. These calls default to
|
|
153
|
+
`persist=false`: they do not write raw/staging/core/factor data and do not imply
|
|
154
|
+
that the interface has a Collector task template.
|
|
155
|
+
|
|
156
|
+
```python
|
|
157
|
+
quote = client.call(
|
|
158
|
+
"stock_realtime_snapshot_tdx",
|
|
159
|
+
code="000001.SZ",
|
|
160
|
+
fields=["instrument_id", "last_price", "change_pct"],
|
|
161
|
+
)
|
|
162
|
+
index_bars = client.call("index_kline_tdx", code="000001.SH", period="day", count=20)
|
|
163
|
+
etf_bars = client.call("etf_kline_tdx", code="510050.SH", period="day", count=20)
|
|
164
|
+
intraday = client.call("stock_intraday_today_tdx", code="000001.SZ")
|
|
165
|
+
recent_intraday = client.call("stock_intraday_recent_history_tdx", code="000001.SZ", trade_date="20260519")
|
|
166
|
+
index_intraday = client.call("index_intraday_history_tdx", code="000001.SH", trade_date="20260617")
|
|
167
|
+
etf_trades = client.call("etf_trades_today_tdx", code="510050.SH")
|
|
168
|
+
trades = client.call("stock_trades_history_tdx", code="000001.SZ", trade_date="20260511")
|
|
169
|
+
finance = client.call("stock_finance_summary_tdx", code="000001.SZ")
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
For high-frequency polling, keep a local source session open instead of looping
|
|
173
|
+
plain `client.call(...)`:
|
|
174
|
+
|
|
175
|
+
```python
|
|
176
|
+
with client.session(source="tdx", source_server_count=4, connections_per_server=2) as session:
|
|
177
|
+
snapshot = session.call("stock_realtime_snapshot_tdx", code=["000001.SZ", "600000.SH"])
|
|
178
|
+
rank = session.call("stock_realtime_rank_tdx", category="a_share")
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Realtime streams follow the same local/remote boundary:
|
|
182
|
+
|
|
183
|
+
```python
|
|
184
|
+
local = ax.AxDataClient()
|
|
185
|
+
with local.stream("stock_quote_refresh_tdx", code=["000001.SZ"]) as stream:
|
|
186
|
+
for event in stream:
|
|
187
|
+
print(event.type, event.data)
|
|
188
|
+
|
|
189
|
+
remote = ax.AxDataClient(api_base="http://192.168.1.20:8666", token="your-token")
|
|
190
|
+
with remote.stream("stock_quote_refresh_tdx", code=["000001.SZ"]) as stream:
|
|
191
|
+
for event in stream:
|
|
192
|
+
print(event.type, event.data)
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
The `code` parameter can be a single string, a list, or a comma-separated string.
|
|
196
|
+
Source-only K-line and ranking previews use bounded defaults; pass `count`
|
|
197
|
+
explicitly when you need a larger sample. Intraday, trade-detail, auction,
|
|
198
|
+
finance, index, and ETF examples remain temporary source requests, not Collector
|
|
199
|
+
task templates.
|
|
200
|
+
Token values are sent as
|
|
201
|
+
`Authorization: Bearer ...`.
|
|
202
|
+
All query methods return a `pandas.DataFrame`.
|
|
203
|
+
The SDK returns `pandas.DataFrame` objects from query and source-request calls.
|
|
204
|
+
|
|
205
|
+
The old `stock_basic()` method name may remain as a migration alias for
|
|
206
|
+
`stock_basic_exchange()`, but new notebooks and applications should use the
|
|
207
|
+
explicit interface name.
|
|
208
|
+
|
|
209
|
+
`download(...)` and `get(...)` are local cache style placeholders for now. They
|
|
210
|
+
raise `NotImplementedError` until the cache workflow is implemented.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""AxData Python SDK."""
|
|
2
|
+
|
|
3
|
+
from .cache import download, get
|
|
4
|
+
from .client import AxDataClient, AxDataError, Client, connect, pro_api
|
|
5
|
+
|
|
6
|
+
__all__ = [
|
|
7
|
+
"AxDataClient",
|
|
8
|
+
"AxDataError",
|
|
9
|
+
"Client",
|
|
10
|
+
"connect",
|
|
11
|
+
"download",
|
|
12
|
+
"get",
|
|
13
|
+
"pro_api",
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
__version__ = "0.1.0"
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""Local cache API placeholders for AxData."""
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def download(*args, **kwargs):
|
|
5
|
+
"""Placeholder for a future local cache download implementation."""
|
|
6
|
+
|
|
7
|
+
raise NotImplementedError(
|
|
8
|
+
"axdata.download(...) is reserved for the future local cache workflow. "
|
|
9
|
+
"It will download API data into a local cache when implemented."
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def get(*args, **kwargs):
|
|
14
|
+
"""Placeholder for a future local cache read implementation."""
|
|
15
|
+
|
|
16
|
+
raise NotImplementedError(
|
|
17
|
+
"axdata.get(...) is reserved for the future local cache workflow. "
|
|
18
|
+
"It will read data from the local cache when implemented."
|
|
19
|
+
)
|