mirror of
https://ghfast.top/https://github.com/aeroxw/easy_tdx_max.git
synced 2026-09-12 13:24:18 +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
531 B
Python
16 lines
531 B
Python
"""演示:获取历史某日分时数据。date 参数为 YYYYMMDD 格式的整数。"""
|
|
|
|
import pandas as pd
|
|
from easy_tdx import TdxClient, Market
|
|
|
|
with TdxClient.from_best_host() as c:
|
|
date = 20250110
|
|
bars = c.get_history_minute_time_data(Market.SH, "600000", date)
|
|
df = pd.DataFrame([{
|
|
"序号": i + 1,
|
|
"价格": bar.price,
|
|
"成交量": bar.vol,
|
|
} for i, bar in enumerate(bars)])
|
|
print(f"浦发银行 {date} 分时数据,共 {len(df)} 条:")
|
|
print(df.to_string(index=False))
|