mirror of
https://ghfast.top/https://github.com/aeroxw/easy-tdx.git
synced 2026-09-12 13:24:15 +08:00
- Package directory: src/xmtdx/ -> src/easy_tdx/ - Import path: from easy_tdx import ... - pip install easy-tdx - Add LICENSE (MIT) with upstream attribution (pytdx, xmtdx) - Add NOTICE with detailed attribution - Update all examples, tests, scripts, docs - Bump version to 1.0.0 BREAKING CHANGE: import path changed from `xmtdx` to `easy_tdx` Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
16 lines
625 B
Python
16 lines
625 B
Python
"""演示:获取个股历史日线资金流向序列。"""
|
|
|
|
import pandas as pd
|
|
from easy_tdx import TdxClient, Market
|
|
|
|
with TdxClient.from_best_host() as c:
|
|
flows = c.get_history_fund_flow(Market.SH, "600519", 0, 10)
|
|
df = pd.DataFrame([{
|
|
"日期": f"{f.year}-{f.month:02d}-{f.day:02d}",
|
|
"超大单净流入(亿)": (f.super_in - f.super_out) / 1e8,
|
|
"大单净流入(亿)": (f.large_in - f.large_out) / 1e8,
|
|
"主力净流入(亿)": f.main_net_inflow / 1e8,
|
|
} for f in flows])
|
|
print(f"贵州茅台 历史资金流向,共 {len(df)} 天:")
|
|
print(df.to_string(index=False))
|