mirror of
https://ghfast.top/https://github.com/aeroxw/easy_tdx_max.git
synced 2026-09-12 18:04:20 +08:00
- Add MacClient/AsyncMacClient with full MAC protocol support (quotes, kline with adjustment, tick charts, transactions, boards, capital flow, auction, unusual, symbol info, server info) - Add MacExClient/AsyncMacExClient for extended markets (HK, US, futures) - Add UnifiedTdxClient auto-routing between A-share and extended markets - Add `easy-tdx` CLI tool with JSON default output, Agent-friendly - Add field bitmap protocol for custom quote field selection - Fix quote-list missing fields (default to BASIC+VOLUME preset) - Add config.py with centralized host management and auto-discovery - Add 50+ examples covering all APIs (01-20) - Rewrite README with CLI-first, Agent-friendly documentation - Bump version to 1.1.0 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
31 lines
831 B
Python
31 lines
831 B
Python
"""集合竞价命令。"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import click
|
|
|
|
|
|
@click.command()
|
|
@click.argument("market")
|
|
@click.argument("code")
|
|
@click.option("--table", "use_table", is_flag=True, help="表格输出")
|
|
@click.option("--output", "output_fmt", type=click.Choice(["json", "table", "csv"]), default="json")
|
|
def auction(market: str, code: str, use_table: bool, output_fmt: str) -> None:
|
|
"""获取集合竞价数据。
|
|
|
|
示例:
|
|
|
|
easy-tdx auction SZ 000001
|
|
|
|
easy-tdx auction SH 600519 --table
|
|
"""
|
|
from .conn import get_mac_client
|
|
from .output import print_output
|
|
from .parsers import parse_market
|
|
|
|
fmt = "table" if use_table else output_fmt
|
|
mkt = parse_market(market)
|
|
with get_mac_client() as client:
|
|
df = client.get_auction(mkt, code)
|
|
print_output(df, fmt)
|