057bc4493e
Wraps the entire yfinance public API behind a single binary `yfin` with
51 subcommands across 13 namespaces (ticker, download, tickers, search,
lookup, market, sector, industry, calendars, screen, live, auth, config).
Output renders as Rich tables on TTY, JSON when piped; --format / --out
support table | json | ndjson | csv | tsv | parquet | yaml.
Highlights:
- 1857 LOC across 18 Python files under cli/yfin/
- Typer + Rich, packaged via hatchling + uv
- Install globally: `cd cli && uv tool install -e .`
- ~/.yfin/config.toml for persistent proxy/cookies/locale defaults
- Friendly YFRateLimitError handler (exit 2, no Rich traceback)
- Validated end-to-end with 33 live tests against Yahoo from a
residential exit (AAPL, MSFT, NVDA, options, screens, calendars,
financials, news, holders, parquet round-trip)
yfinance-tools.yaml is the single source of truth:
- tools (49) — every public yfinance entry point with parameters
- cli (13 groups) — exact CLI invocations, mapped back to tool names
- outputSchemas (27) — actual return shapes captured from live calls
- learnings (19) — IP rate-limit, crumb handshake, Typer gotchas,
screen-build wrapping rules, upstream stubs, etc.
CLAUDE.md documents the upstream codebase layout for future agents.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
37 lines
1008 B
TOML
37 lines
1008 B
TOML
[project]
|
|
name = "yfin"
|
|
version = "0.1.0"
|
|
description = "Single-binary CLI for the yfinance library — Pythonic access to Yahoo! Finance data from the shell."
|
|
readme = "README.md"
|
|
requires-python = ">=3.10"
|
|
authors = [{ name = "yfin contributors" }]
|
|
license = { text = "Apache-2.0" }
|
|
classifiers = [
|
|
"License :: OSI Approved :: Apache Software License",
|
|
"Programming Language :: Python :: 3",
|
|
"Topic :: Office/Business :: Financial",
|
|
]
|
|
dependencies = [
|
|
"typer>=0.12",
|
|
"rich>=13",
|
|
"yfinance>=1.4.1",
|
|
"pyarrow>=14",
|
|
"PyYAML>=6",
|
|
"pandas>=1.3.0",
|
|
"lxml>=4.9", # earnings_dates uses pandas.read_html
|
|
"html5lib>=1.1", # extra HTML backend
|
|
"requests_cache>=1.0", # `nospam` extra
|
|
"requests_ratelimiter>=0.3.1",
|
|
"scipy>=1.6.3", # repair=True heuristics
|
|
]
|
|
|
|
[project.scripts]
|
|
yfin = "yfin.__main__:main"
|
|
|
|
[build-system]
|
|
requires = ["hatchling"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[tool.hatch.build.targets.wheel]
|
|
packages = ["yfin"]
|