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, 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.1.1.tar.gz
(100.2 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.1.1-py3-none-any.whl
(15.0 kB
view details)
File details
Details for the file yfin_cli-0.1.1.tar.gz.
File metadata
- Download URL: yfin_cli-0.1.1.tar.gz
- Upload date:
- Size: 100.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff08078b6a0145d01a5e2910e84276f5014a1540b9e638023518374641be9d87
|
|
| MD5 |
867e4d9ab0f84dc7f55741c670a49c2d
|
|
| BLAKE2b-256 |
6ac715a944fc4d889e59b00507c8a46625a3d71922aad0b183e8196d2a360a33
|
File details
Details for the file yfin_cli-0.1.1-py3-none-any.whl.
File metadata
- Download URL: yfin_cli-0.1.1-py3-none-any.whl
- Upload date:
- Size: 15.0 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 |
7cb1e5a2fc254ef7d229a421aeba488e6833d37a0a22466f02b694583ff7e256
|
|
| MD5 |
c5354d3628c16929425c609e17ed7be1
|
|
| BLAKE2b-256 |
a1d296254cbc127d29430069c77ddc3fe87a8052b9f59e5fdb7785da5281468e
|