An A-share (China stock market) after-hours CLI that just works — no login, no API keys, no scraping tricks. Also covers HK & US indices and a global snapshot.
A single command (young a) prints a complete after-hours dashboard: major indices, limit-up (涨停) and limit-down pools, fund flow, and top sector boards. Everything pulls from Eastmoney's public endpoints, with a 7-day local cache so repeated calls during the same session don't hammer the server.
Born out of a real workflow: every trading day after close I wanted the same five numbers in one place without opening a browser or paying for a data terminal. So I packaged it.
pip install young-stock-cliRequires Python 3.10+.
young a # A-share after-hours dashboard (the main thing)
young hk # Hong Kong indices snapshot
young us # US indices snapshot
young global # A + HK + US in one view
young indices # A-share indices only
young zt-pool # limit-up (涨停) / limit-down / 炸板 pool
young flow # north-bound + main-capital fund flow
young a -d 20260530 # historical date (YYYYMMDD)
young a --refresh # bypass cache, force re-fetch
young indices --json # pipe-friendly JSON for scripts
young a --zt --json # JSON for limit-up / limit-down / broken-board pools
young update # upgrade young-stock-cli in the current Python env
young --helpJSON output is available on the market data commands, so pipeline users can skip the rich tables:
young indices --json | jq '.indices[] | .f12'
young flow --json | jq '.flow'
young global --json | jq '.hk[] | {symbol, price}'A股主要指数 — 2026-05-30 收盘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━┓
┃ 指数 ┃ 收盘 ┃ 涨跌幅 ┃ 成交额 ┃ 振幅 ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━┩
│ 上证指数 │ 3,347.49 │ +0.62% │ 4,821亿 │ 1.18% │
│ 深证成指 │ 10,402.91 │ +0.95% │ 6,015亿 │ 1.42% │
│ 创业板指 │ 2,135.66 │ +1.21% │ 2,310亿 │ 1.68% │
│ 科创50 │ 1,028.74 │ +0.81% │ 412亿 │ 1.05% │
└─────────────────────────────┴───────────┴────────┴─────────┴──────────┘
Most A-share data libraries either (a) require paid accounts, (b) break the moment a portal redesigns its DOM, or (c) ship hundreds of MB of dependencies for a one-off after-hours glance. This is a 1-file core, three runtime deps (requests, click, rich), opinionated output, and a single command that prints what a trader actually wants at 15:01.
It is also a foundation for analysis pipelines: every subcommand maps to a Python function in young_stock._core, so you can from young_stock._core import get_zt_pool, get_fund_flow and feed the dicts into your own notebook or LLM prompt.
- Multiple public quote sources — Tencent Finance, Sina Finance, and Eastmoney are tried in sequence so temporary source failures can be filled by another no-login endpoint.
- Smart caching —
~/.young_stock/cache/, 7-day TTL, auto-pruned. Pass--refreshto skip. - Trade-day awareness — nearest-trade-day resolution including weekends and (best-effort) holidays.
- Rich terminal tables — readable on dark and light terminals.
- Sector boards via browser fallback — when Eastmoney's board API rate-limits, falls back to rendering the public web page (optional, requires a local browser engine).
- Local updater —
young updaterunspython -m pip install --upgrade young-stock-cliwith the same interpreter that launched the CLI.
from young_stock._core import get_index, get_zt_pool, nearest_trade_date
date = nearest_trade_date()
print(get_index(date))
print(get_zt_pool(date))git clone https://github.com/AdvancingTitans/young-stock-cli.git
cd young-stock-cli
pip install -e ".[dev]"
pytest
ruff check .- Optional JSON output (
--json) for piping into downstream tools. - Built-in trading-calendar (公开节假日) for accurate non-trade-day skipping.
- Plugin hooks for additional data sources (THS, Sina).
-
young watch— live ticker mode during trading hours.
PRs welcome — see CONTRIBUTING.md.
MIT — see LICENSE.
A 股盘后行情命令行工具。免登录、免 API key、免反爬技巧 — 一行命令把当日涨跌、涨停板、资金流向、板块榜全部打到终端。同时支持港股、美股指数和全球快照视图。
pip install young-stock-cli
young a # A 股盘后总览(主命令)
young zt-pool # 涨停 / 跌停 / 炸板分析
young flow # 北向资金 + 主力资金流向
young global # 全球指数一屏
young a -d 20260530 --refresh # 指定日期 + 强制刷新
young update # 在当前 Python 环境中更新 CLI数据来源:腾讯财经、新浪财经、东方财富公开行情接口(qt.gtimg.cn / hq.sinajs.cn / push2.eastmoney.com / push2ex.eastmoney.com),多源自动切换。本地缓存 7 天,目录 ~/.young_stock/cache/,可用 young cache-clear 清理。
适用人群:每天盘后想用一条命令看完五张图的开发者 / 量化研究者 / 自动化爱好者。欢迎 issue / PR。