yahoo-finance
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseYahoo Finance CLI
Yahoo Finance CLI
Financial data terminal powered by Yahoo Finance. All commands via the script.
yf由Yahoo Finance驱动的金融数据终端。所有命令均通过脚本执行。
yfSetup
安装配置
The script is at . It uses with inline PEP 723 metadata — dependencies install automatically on first run.
{baseDir}/scripts/yfuv run --scriptbash
chmod +x {baseDir}/scripts/yf脚本位于。它使用带有内嵌PEP 723元数据的,首次运行时会自动安装依赖。
{baseDir}/scripts/yfuv run --scriptbash
chmod +x {baseDir}/scripts/yfCommands
命令列表
| Command | Purpose | Example |
|---|---|---|
| Quick price + change + volume | |
| Detailed quote (52w, PE, yield) | |
| Side-by-side comparison table | |
| Credit analysis: leverage, coverage, debt maturity | |
| Morning macro dashboard (UST, DXY, VIX, oil, gold, BTC, ARS) | |
| LatAm FX rates (ARS, BRL, CLP, MXN, COP) | |
| ETF top holdings + fund data | |
| Price history (1d/5d/1mo/3mo/6mo/1y/ytd/max) | |
| Full financials (IS, BS, CF) | |
| Recent news headlines | |
| Find tickers | |
All commands support for machine-readable output.
--json| 命令 | 用途 | 示例 |
|---|---|---|
| 快速查看价格+涨跌幅+成交量 | |
| 详细报价(52周数据、市盈率、收益率) | |
| 多标的并排对比表格 | |
| 信用分析:杠杆率、利息保障倍数、债务到期情况 | |
| 晨间宏观数据仪表盘(美国国债、DXY、VIX、原油、黄金、BTC、ARS) | |
| 拉美外汇汇率(ARS、BRL、CLP、MXN、COP) | |
| ETF持仓Top榜+基金数据 | |
| 价格历史数据(1天/5天/1月/3月/6月/1年/年初至今/全部) | |
| 完整财务数据(利润表、资产负债表、现金流表) | |
| 近期新闻头条 | |
| 查找标的代码 | |
所有命令均支持参数,以生成机器可读的输出格式。
--jsonWhen to Use Which Command
命令使用场景
- Morning check: → get UST yields, DXY, VIX, commodities, BTC, ARS in one shot
yf macro - Quick look: → fast price/change/volume
yf price TICKER - Deep dive equity: →
yf quote→yf fundamentalsyf history - Credit analysis: → leverage ratios, interest coverage, debt breakdown
yf credit TICKER - EM/LatAm FX: → all major LatAm pairs vs USD
yf fx - ETF research: → top holdings, AUM, expense ratio
yf flows ETF - Comparison: → side-by-side for relative value
yf compare
- 晨间复盘:→ 一键获取美国国债收益率、DXY、VIX、大宗商品、BTC、ARS数据
yf macro - 快速查看:→ 快速获取价格/涨跌幅/成交量
yf price TICKER - 个股深度分析:→
yf quote→yf fundamentalsyf history - 信用分析:→ 获取杠杆率、利息保障倍数、债务明细
yf credit TICKER - 新兴市场/拉美外汇:→ 获取所有拉美主要货币对美元的汇率
yf fx - ETF研究:→ 获取持仓Top榜、资产管理规模、费率
yf flows ETF - 标的对比:→ 多标的并排对比,分析相对价值
yf compare
Error Handling
错误处理
The script handles bad tickers, missing data, and rate limits gracefully with clear error messages. If Yahoo Finance rate-limits, wait a moment and retry.
脚本会优雅处理无效标的代码、缺失数据及限流问题,并给出清晰的错误提示。若触发Yahoo Finance限流,请稍候重试。
Output
输出格式
By default, output uses Rich tables for clean terminal display. Add to any command for structured JSON output suitable for piping or further processing.
--json默认情况下,输出使用Rich表格在终端中清晰展示。在任意命令后添加参数,可生成结构化JSON输出,便于管道传输或进一步处理。
--json