Files
easy_tdx_max/src/easy_tdx/cli/cmd_capital.py
T
GitHubandClaude Opus 4.7 4820b4a049 feat: v1.1.0 - MAC protocol, CLI tool, extended markets, unified client
- 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>
2026-05-22 22:44:45 +08:00

31 lines
871 B
Python

"""资金流向命令。"""
from __future__ import annotations
import click
@click.command("capital-flow")
@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 capital_flow(market: str, code: str, use_table: bool, output_fmt: str) -> None:
"""获取个股资金流向数据。
示例:
easy-tdx capital-flow SZ 000001
easy-tdx capital-flow 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_capital_flow(mkt, code)
print_output(df, fmt)