A command-line interface for Yahoo Finance data
Project description
yfin-cli
A command-line interface for Yahoo Finance data, powered by yfinance.
Why yfin-cli
- Fast, scriptable access to Yahoo Finance data.
- JSON or table output for easy piping.
- Broad coverage: prices, financials, analyst data, screeners, sectors, industries.
Install
Requires Python 3.10+.
From PyPI (recommended)
pipx install yfin-cli
# or
pip install yfin-cli
# or
uv tool install yfin-cli
From source
git clone <your-repo-url>
cd yfin-cli
uv tool install .
# or
pip install .
Usage
Quickstart
# Get historical stock data
yfin history AAPL
# Get quick summary metrics
yfin fast-info TSLA
# Check market status
yfin market-status
# View quarterly income statement
yfin income-stmt MSFT --frequency quarterly
# Get analyst recommendations
yfin recommendations NVDA
# Screen stocks
yfin screen --filter "sector eq Technology" --filter "intradaymarketcap gt 100000000000"
# Use a predefined screener
yfin screen --predefined day_gainers
# Output as a table
yfin --output table history AAPL --period 1y
For the complete command reference with all options and parameters, see COMMANDS.md.
Global options:
| Option | Description | Default |
|---|---|---|
--output |
Output format (json, table) |
json |
--help |
Show help message | — |
Available Commands
| Category | Commands |
|---|---|
| Stock | history, dividends, fast-info, info, news |
| Market | market-status |
| Calendar | calendar-earnings, calendar-economic-events, calendar-ipo |
| Financials | income-stmt, balance-sheet, cashflow, earnings-dates, sec-filings |
| Analysis | recommendations, upgrades-downgrades, price-targets, earnings-estimate, revenue-estimate, earnings-history, eps-trend, eps-revisions, growth-estimates |
| Holders | insider-purchases, insider-transactions, insider-roster-holders, major-holders, institutional-holders, mutualfund-holders |
| Sector | sector-keys, sector-industries, sector-overview, sector-research-reports, sector-top-companies, sector-top-etfs, sector-top-mutual-funds |
| Industry | industry-overview, industry-research-reports, industry-top-companies, industry-top-growth-companies, industry-top-performing-companies |
| Screen | screen, screen-query-fields, screen-query-values, screen-predefined-queries |
Development
This project uses uv for dependency management.
# Install dependencies
uv sync
# Run the CLI
uv run yfin --help
# Run tests
uv run pytest
# Format code
uv run ruff format .
# Build package
uv build
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
yfin_cli-0.2.0.tar.gz
(100.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
yfin_cli-0.2.0-py3-none-any.whl
(15.2 kB
view details)
File details
Details for the file yfin_cli-0.2.0.tar.gz.
File metadata
- Download URL: yfin_cli-0.2.0.tar.gz
- Upload date:
- Size: 100.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8730d43a4443b5b4619beaabc85d2fa2ab44064857cede3d3550c3a6d0cd7907
|
|
| MD5 |
9b53e1165d1e5cedde3d440a22e2b64f
|
|
| BLAKE2b-256 |
3ff288c054cfb05b341fa72a5f7827e10f9586f3298cbf1ff03dd936104f8ca7
|
File details
Details for the file yfin_cli-0.2.0-py3-none-any.whl.
File metadata
- Download URL: yfin_cli-0.2.0-py3-none-any.whl
- Upload date:
- Size: 15.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1ffb39b11c6879c2343588a168e6562b31017010ad27d09e81de6b00ad4b05a
|
|
| MD5 |
7e236b8bf6c4e82c1260394302be86c6
|
|
| BLAKE2b-256 |
98349403c7fc17802e8992be2bcc2c145954c36e834e6bdadd1fbb828a8ede13
|